This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check user for team affiliation | |
on: | |
push: | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
check-user: | |
name: Team affiliation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check user for team affiliation | |
uses: tspascoal/get-user-teams-membership@v2 | |
id: teamAffiliation | |
with: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
username: ${{ github.actor }} | |
team: your-team-name | |
- name: Stop workflow if user is no member | |
if: ${{ steps.teamAffiliation.outputs.isTeamMember == false }} | |
run: | | |
echo "You have no rights to trigger this job." | |
exit 1 |