Skip to content

Commit b3112fd

Browse files
authored
Add claude allowlist check in workflow for issue and PR events (#739)
Doesnt include myself to test if it works :D
1 parent 639cdb2 commit b3112fd

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/claude-allowed-users

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
auhlig
2+
umswmayj
3+
juliusclausnitzer
4+
mblos
5+
PhilippMatthes
6+
Varsius
7+
henrichter

.github/workflows/claude-on-issues-and-prs.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,29 @@ on:
1111
types: [submitted]
1212

1313
jobs:
14+
check-allowlist:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
allowed: ${{ steps.check.outputs.allowed }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 1
22+
- name: Check sender against allowlist
23+
id: check
24+
run: |
25+
if grep -qxF "${{ github.event.sender.login }}" \
26+
<(grep -v '^#' .github/claude-allowed-users | sed '/^[[:space:]]*$/d'); then
27+
echo "allowed=true" >> $GITHUB_OUTPUT
28+
else
29+
echo "allowed=false" >> $GITHUB_OUTPUT
30+
fi
31+
1432
claude:
15-
if: github.event.sender.type == 'User'
33+
needs: check-allowlist
34+
if: >
35+
github.event.sender.type == 'User' &&
36+
needs.check-allowlist.outputs.allowed == 'true'
1637
runs-on: ubuntu-latest
1738
permissions:
1839
contents: write

0 commit comments

Comments
 (0)