This action provides the following functionality for GitHub Actions users:
- Check if given user belongs to given teams in an organization
- Optionally, action is able to fail if given user doesn't belong to given teams
See action.yml
The token
is reqiuired because buitin GITHUB_TOKEN
's scope is insufficient.
You should pass token that has read:org
scope.
steps:
- uses: 44smkn/check-teams-user-belongs@v1
with:
username: ${{ github.actor }}
teams: admin
token: ${{ secrets.PAT_ONLY_READ_ORG }}
steps:
- uses: 44smkn/check-teams-user-belongs@v1
with:
username: ${{ github.actor }}
organization: company
teams: |
admin
owners
token: ${{ secrets.PAT_ONLY_READ_ORG }}
failIfUserNotBelongs: true