From 84ca90ae9756c056d581bc9de67d192ac05a1a28 Mon Sep 17 00:00:00 2001 From: Dan Ditomaso Date: Wed, 19 Feb 2025 11:47:07 -0500 Subject: [PATCH] fix: further action changes. --- .github/workflows/format.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index fcff678e..ec8efd55 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,11 +1,8 @@ name: Code Formatting on: - push: - branches: [ main, master ] pull_request: branches: [ main, master ] - # Allow manual triggering workflow_dispatch: jobs: @@ -13,15 +10,16 @@ jobs: runs-on: ubuntu-latest permissions: - # Give the default GITHUB_TOKEN write permission to commit and push contents: write + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4 with: - fetch-depth: 0 - token: ${{ github.token }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -39,18 +37,12 @@ jobs: run: | git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT - - name: Configure Git - if: steps.git-check.outputs.changes == 'true' - run: | - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - - name: Commit and push changes if: steps.git-check.outputs.changes == 'true' run: | - branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} - echo "Current branch: $branch_name" - git add -A - git status - git commit -m "chore: format code" - git push origin HEAD:$branch_name \ No newline at end of file + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + git add -A + git commit -m "chore: format code" + git push \ No newline at end of file