File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change 1717 name : Publish OIL Tag & Release CLI
1818 runs-on : ubuntu-latest
1919 steps :
20- - name : 🔐 Gatekeeper (Access Control)
21- id : gatekeeper
22- env :
23- GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
24- ACTOR : ${{ github.actor }}
25- ORG : newrelic
26- TEAM_1 : virtuoso
27- TEAM_2 : oac
28- run : |
29- echo "👮 Verifying if user '$ACTOR' is authorized to run this workflow..."
30-
31- # Function to check team membership via API
32- check_membership() {
33- local TEAM_SLUG=$1
34- local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
35- -H "Authorization: token $GITHUB_TOKEN" \
36- "https://api.github.com/orgs/$ORG/teams/$TEAM_SLUG/memberships/$ACTOR")
37-
38- if [[ "$HTTP_STATUS" == "200" ]]; then return 0; else return 1; fi
39- }
40-
41- if check_membership "$TEAM_1"; then
42- echo "✅ User '$ACTOR' is a member of '$TEAM_1'. Access Granted."
43- elif check_membership "$TEAM_2"; then
44- echo "✅ User '$ACTOR' is a member of '$TEAM_2'. Access Granted."
45- else
46- echo "⛔ ACCESS DENIED: User '$ACTOR' is not a member of '$TEAM_1' or '$TEAM_2'."
47- echo "💀 Aborting workflow."
48- exit 1
49- fi
50-
5120 - name : 🛡️ Verify Version Input Consistency
5221 run : |
5322 echo "👮 Performing Safety Check on Version Inputs..."
You can’t perform that action at this time.
0 commit comments