Skip to content

Commit 5bb18e0

Browse files
committed
ci: add Cyclops PR audit workflow
1 parent aa78cdf commit 5bb18e0

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/pr-audit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR Audit
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
7+
jobs:
8+
gate:
9+
if: github.event.label.name == 'cyclops'
10+
runs-on: ubuntu-latest
11+
outputs:
12+
allowed: ${{ steps.check.outputs.allowed }}
13+
steps:
14+
- id: check
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
run: |
18+
PERM=$(gh api "repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission" --jq '.permission')
19+
if [ "$PERM" = "admin" ]; then
20+
echo "allowed=true" >> "$GITHUB_OUTPUT"
21+
fi
22+
23+
pr-audit:
24+
needs: gate
25+
if: needs.gate.outputs.allowed == 'true'
26+
uses: tempoxyz/gh-actions/.github/workflows/pr-audit.yml@main
27+
secrets: inherit

0 commit comments

Comments
 (0)