File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check membership
2+
3+ on :
4+ push :
5+ branches :
6+ - julio/publising/add-job-to-whitelist-crate-releases
7+ workflow_dispatch :
8+ # pull_request:
9+ # types: [opened, edited]
10+ jobs :
11+ get-token :
12+ name : read contents of another repo
13+ runs-on : ubuntu-latest
14+ permissions :
15+ id-token : write # Needed to federate tokens.
16+ outputs :
17+ sts_token : ${{ steps.octo-sts.outputs.token }}
18+ steps :
19+ - uses : DataDog/dd-octo-sts-action@08f2144903ced3254a3dafec2592563409ba2aa0 # v1.0.1
20+ id : octo-sts
21+ with :
22+ scope : DataDog/libdatadog # target repository
23+ policy : YOUR_POLICY # trust policy in target repo, without the .sts.yaml extension
24+ - name : Use GH token
25+ run : |
26+ gh auth status
27+ gh repo list --visibility=internal DataDog
28+ env :
29+ GH_TOKEN : ${{ steps.octo-sts.outputs.token }}
30+ GH_PAGER : cat # (unrelated) needed to disable paging of gh cli
31+
32+ check-membership :
33+ runs-on : ubuntu-latest
34+ needs : get-token
35+ steps :
36+ - name : Check if user is in the team allowed to make crate releases
37+ id : check
38+ uses : TheModdingInquisition/actions-team-membership@057d91bb80f2976a1bc6dfab5b4ae1da9aebbd89 # v1.0.1
39+ with :
40+ team : ' libdatadog-owners'
41+ organization : ' Datadog'
42+ token : ${{ needs.get-token.outputs.sts_token }} # Needs 'read:org' scope
43+ exit : false
44+
45+ - name : Check output
46+ run : |
47+ echo "User is permitted: ${{ steps.check.outputs.permitted }}"
48+ echo "Teams: ${{ steps.check.outputs.teams }}"
49+
You can’t perform that action at this time.
0 commit comments