From ffc8f0b9ec0392e72ec1c2448928fef2f8722e3f Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 26 Jul 2024 08:49:44 +1000 Subject: [PATCH] chore: attempt to auto format PRs --- .github/workflows/{autofmt.yml => autofmtpr.yml} | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) rename .github/workflows/{autofmt.yml => autofmtpr.yml} (78%) diff --git a/.github/workflows/autofmt.yml b/.github/workflows/autofmtpr.yml similarity index 78% rename from .github/workflows/autofmt.yml rename to .github/workflows/autofmtpr.yml index 6ae37700b0..f915264a22 100644 --- a/.github/workflows/autofmt.yml +++ b/.github/workflows/autofmtpr.yml @@ -1,16 +1,12 @@ on: - schedule: - # Run daily - - cron: "0 22 * * *" -name: Auto-format + pull_request: +name: Auto-format Pull Request jobs: format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: main - fetch-depth: 0 token: ${{ secrets.FTL_AUTOFMT_TOKEN }} - name: Init Hermit run: ./bin/hermit env -r >> "$GITHUB_ENV" @@ -24,5 +20,5 @@ jobs: run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - git commit -am "chore(autofmt): Automated formatting" - git push + git commit -a -m "Fix format" + git push origin HEAD:${{ github.head_ref }}