☞ GitHub Actions to get a GitHub Team Members list
Observation: This action can also be used to check if the workflow ${{ github.actor }}
belongs to the specified team.
This action needs a GitHub Token or Personal Access Token with the read:org
permission to read organizational team members.
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
token: ${{ secrets.GITHUB_TOKEN }}
- run: "echo ${{ steps.get-members.outputs.members }}"
shell: bash
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
role: maintainer
token: ${{ secrets.GITHUB_TOKEN }}
- run: "echo ${{ steps.get-members.outputs.members }}"
shell: bash
- id: get-members
uses: GuillaumeFalourd/github-team-members@v1
with:
org_slug: org-slug
team_slug: team-slug
token: ${{ secrets.GITHUB_TOKEN }}
- if: steps.get-members.outputs.actor-belongs-team == 'true'
run: echo "${{ github.actor }} belongs to Team"
shell: bash
- if: steps.get-members.outputs.actor-belongs-team == 'false'
run: echo "${{ github.actor }} doesn't belong to Team"
shell: bash
Field | Mandatory | Default Value | Observation |
---|---|---|---|
org_slug | YES | - | Organization's name e.g: my-org |
team_slug | YES | - | Team's Slug e.g: my-team |
role | NO | all |
Members Role e.g: member , maintainer or all |
token | NO | ${{ github.token }} |
Personal Access Token to read org team. |
Field | Observation |
---|---|
data | Raw member data from GitHub API |
members | Team members list |
actor-belongs-team | If the workflow ${{ github.actor }} belongs to the team. e.g: true or false |
☞ If you're interested in contributing to this repository, please follow the guidelines
☞ This repository uses the Apache License 2.0