diff --git a/.github/workflows/comment-pr-artifacts.yml b/.github/workflows/comment-pr-artifacts.yml index 86fda296..b7f0fb2a 100644 --- a/.github/workflows/comment-pr-artifacts.yml +++ b/.github/workflows/comment-pr-artifacts.yml @@ -4,6 +4,7 @@ on: pull_request_target: types: - opened + - edited - synchronize - reopened - ready_for_review @@ -19,7 +20,7 @@ jobs: runs-on: ubuntu-latest env: ALLOWED_ACTORS: ${{ vars.ALLOWED_NON_DEV_PR_ACTORS }} - ACTOR: ${{ github.actor }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} BASE_REF: ${{ github.event.pull_request.base.ref }} IS_DRAFT: ${{ github.event.pull_request.draft }} PR_NUMBER: ${{ github.event.pull_request.number }} @@ -37,7 +38,7 @@ jobs: fi normalized=",${ALLOWED_ACTORS}," - if [[ "$normalized" == *",${ACTOR},"* ]]; then + if [[ "$normalized" == *",${PR_AUTHOR},"* ]]; then echo "allowed=true" >> "$GITHUB_OUTPUT" else echo "allowed=false" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 442055c4..cf8a11a2 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -4,6 +4,7 @@ on: pull_request: types: - opened + - edited - synchronize - reopened - ready_for_review @@ -23,7 +24,7 @@ jobs: allowed: ${{ steps.auth.outputs.allowed }} env: ALLOWED_ACTORS: ${{ vars.ALLOWED_NON_DEV_PR_ACTORS }} - ACTOR: ${{ github.actor }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} BASE_REF: ${{ github.event.pull_request.base.ref }} steps: - name: Check PR authorization @@ -37,11 +38,11 @@ jobs: fi normalized=",${ALLOWED_ACTORS}," - if [[ "$normalized" == *",${ACTOR},"* ]]; then + if [[ "$normalized" == *",${PR_AUTHOR},"* ]]; then echo "allowed=true" >> "$GITHUB_OUTPUT" else echo "allowed=false" >> "$GITHUB_OUTPUT" - echo "Skipping builds for unauthorized PR targeting $BASE_REF" >&2 + echo "Skipping builds for PR by unauthorized author targeting $BASE_REF" >&2 fi build: diff --git a/.github/workflows/restrict-non-dev-prs.yml b/.github/workflows/restrict-non-dev-prs.yml index 11d43ba9..ab27f943 100644 --- a/.github/workflows/restrict-non-dev-prs.yml +++ b/.github/workflows/restrict-non-dev-prs.yml @@ -4,6 +4,7 @@ on: pull_request_target: types: - opened + - edited - reopened - synchronize @@ -17,7 +18,7 @@ jobs: runs-on: ubuntu-latest env: ALLOWED_ACTORS: ${{ vars.ALLOWED_NON_DEV_PR_ACTORS }} - ACTOR: ${{ github.actor }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_NUMBER: ${{ github.event.pull_request.number }} BASE_REF: ${{ github.event.pull_request.base.ref }} steps: @@ -27,7 +28,7 @@ jobs: run: | set -euo pipefail normalized=",${ALLOWED_ACTORS}," - if [[ "$normalized" == *",${ACTOR},"* ]]; then + if [[ "$normalized" == *",${PR_AUTHOR},"* ]]; then echo "authorized=true" >> "$GITHUB_OUTPUT" else echo "authorized=false" >> "$GITHUB_OUTPUT" @@ -50,5 +51,5 @@ jobs: - name: Fail unauthorized PR if: ${{ steps.auth.outputs.authorized != 'true' }} run: | - echo "Actor $ACTOR is not allowed to open PRs targeting $BASE_REF" >&2 + echo "PR author $PR_AUTHOR is not allowed to open PRs targeting $BASE_REF" >&2 exit 1