Skip to content

Commit f5e1579

Browse files
authored
ci: use AUTHORIZED_USERS for pr-tarball authorization (#642)
1 parent 915125d commit f5e1579

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/pr-tarball.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,27 @@ permissions:
88
pull-requests: write
99

1010
jobs:
11+
authorize:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
is_authorized: ${{ steps.check.outputs.is_authorized }}
15+
steps:
16+
- name: Check authorization
17+
id: check
18+
run: |
19+
AUTHORIZED_USERS="${{ secrets.AUTHORIZED_USERS }}"
20+
if [[ ",$AUTHORIZED_USERS," == *",${{ github.actor }},"* ]]; then
21+
echo "✅ User ${{ github.actor }} is authorized"
22+
echo "is_authorized=true" >> "$GITHUB_OUTPUT"
23+
else
24+
echo "⏭️ User ${{ github.actor }} is not in AUTHORIZED_USERS — skipping."
25+
echo "is_authorized=false" >> "$GITHUB_OUTPUT"
26+
fi
27+
1128
pr-tarball:
29+
needs: authorize
30+
if: needs.authorize.outputs.is_authorized == 'true'
1231
runs-on: ubuntu-latest
13-
if: >-
14-
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)
1532
steps:
1633
- uses: actions/checkout@v6
1734
with:

0 commit comments

Comments
 (0)