From 4e5da551f00d25459fb4f05e0f6d2ce127aa23c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sat, 6 May 2023 16:37:53 +0200 Subject: [PATCH] chore: add `format` workflow (#15) --- .github/workflows/format.yml | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..20d2409 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,44 @@ +name: 👔 Format + +on: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + format: + if: github.repository == 'remix-run/release-comment-action' + runs-on: ubuntu-latest + + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: 🟧 Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + run_install: | + - recursive: true + args: [--frozen-lockfile, --strict-peer-dependencies] + + - name: 👔 Format + run: pnpm run format + + - name: 💪 Commit + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + git add . + if [ -z "$(git status --porcelain)" ]; then + echo "💿 no formatting changed" + exit 0 + fi + git commit -m "chore: format" + git push + echo "💿 pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"