File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,32 @@ permissions:
2727 contents : read
2828
2929jobs :
30- test :
30+ check-permission :
31+ runs-on : ubuntu-latest
32+ outputs :
33+ authorized : ${{ steps.makeDecision.outputs.continue }}
34+ steps :
35+ - id : checkUser
36+ uses : tspascoal/get-user-teams-membership@v3
37+ with :
38+ username : ${{ github.actor }}
39+ team : ' FlagGems'
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+
42+ - id : makeDecision
43+ env :
44+ IS_MEMBER : ${{ steps.checkUser.outputs.isTeamMember }}
45+ run : |
46+ if [[ "${IS_MEMBER}" == "false" ]]; then
47+ echo "Unauthorized user: ${{ github.actor }}"
48+ echo "continue=false" >> $GITHUB_OUTPUT
49+ else
50+ echo "continue=true" >> $GITHUB_OUTPUT
51+ fi
52+
53+ test-operator :
54+ needs : check-permission
55+ if : needs.check-permission.outputs.authorized == 'true'
3156 runs-on : ${{ inputs.runner }}
3257 steps :
3358 # - name: Set global proxy
4772 # ;;
4873 # esac
4974
50- - name : Dump context
51- env :
52- GITHUB_CONTEXT : ${{ toJSON(github) }}
53- run : echo "$GITHUB_CONTEXT"
54-
5575 - uses : actions/checkout@v6
5676 # with:
5777 # ssh-key: ${{ secrets.RUNNER_SSH_KEY }}
You can’t perform that action at this time.
0 commit comments