This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
add back auto merge to main #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format steganography.web | |
on: | |
push: | |
branches: | |
- staging | |
jobs: | |
should_run: | |
uses: JensDll/should-run/.github/workflows/main.yaml@main | |
with: | |
projects: services/steganography.web | |
format: | |
needs: should_run | |
if: fromJSON(needs.should_run.outputs.result)['services/steganography.web'] == 'true' | |
defaults: | |
run: | |
shell: bash | |
working-directory: services/steganography.web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checking out the repository | |
uses: actions/checkout@v3.5.2 | |
- name: Using pnpm version 7.x.x | |
uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7.x.x | |
- name: Using node version 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "pnpm" | |
cache-dependency-path: services/steganography.web/pnpm-lock.yaml | |
- name: Installing dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Formatting code | |
run: pnpm run format | |
- name: Preparing merge | |
id: prepare | |
run: | | |
if ! git diff --quiet | |
then | |
TEMP_BRANCH=$(uuidgen) | |
echo "TEMP_BRANCH=$TEMP_BRANCH" >> $GITHUB_OUTPUT | |
git config user.name github-actions | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git checkout -b $TEMP_BRANCH | |
git add --update | |
git commit --message "github-actions: fix code style" | |
git push origin $TEMP_BRANCH | |
else | |
echo "Nothing to commit!" | |
fi | |
- name: Creating pull request | |
if: steps.prepare.outputs.TEMP_BRANCH != null | |
id: create_pull | |
uses: ./.github/actions/create_pull | |
with: | |
github_token: ${{ secrets.github_token }} | |
base: staging | |
head: ${{ steps.prepare.outputs.TEMP_BRANCH }} | |
title: "github-actions: fix code style" | |
- name: Merging pull request | |
if: steps.create_pull.outputs.pull_number != null | |
uses: ./.github/actions/merge-pull | |
with: | |
github_token: ${{ secrets.github_token }} | |
pull_number: ${{ steps.create-pull.outputs.pull_number }} | |
merge_method: "github_squash" | |
delete_head: true |