diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3ee1eca..2310e27 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,9 +1,14 @@ name: pre-commit on: - pull_request: push: - branches: [main] + branches: + - main + pull_request: + branches: + - '**' +permissions: + contents: write jobs: pre-commit: @@ -12,6 +17,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + ref: ${{ github.head_ref }} - uses: actions/setup-python@v3 - uses: actions/setup-python@v3 - name: Install pre-commit @@ -25,4 +31,4 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Apply formatting changes - branch: ${{ github.head_ref }} # Push changes back to the current branch \ No newline at end of file + branch: ${{ github.head_ref }} \ No newline at end of file