From ec9adac8ff51ff17dea0993d1340fa72e90922c0 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Thu, 26 Dec 2024 12:48:24 +1100 Subject: [PATCH] Try checkout PR head instead of SHA --- .github/workflows/Black.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Black.yml b/.github/workflows/Black.yml index 18767f7b..e773c78b 100644 --- a/.github/workflows/Black.yml +++ b/.github/workflows/Black.yml @@ -2,17 +2,17 @@ name: Black Formatting on: [pull_request] jobs: black: - if: ${{ github.actor != 'dependabot[bot]' }} # Do not run on commits created by dependabot + if: ${{ github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest permissions: - # Give the default GITHUB_TOKEN write permission to commit and push the changed files. - contents: write # Allows reading and writing repository contents (e.g., commits) - pull-requests: write # Allows reading and writing pull requests + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 with: - ref: ${{ github.sha }} - token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.GITHUB_TOKEN }} # Use a PAT with repo scope - name: Black Code Formatter uses: psf/black@stable