Skip to content
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