-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
44 lines (44 loc) · 1.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
name: Get GitHub team members
description: Retrieve team members from a GitHub team
branding:
icon: 'users'
color: 'yellow'
inputs:
org:
description: Name of the org
required: true
default: ${{ github.repository_owner }}
team_slug:
description: Slug of the team
required: true
role:
description: 'Role of the member. Must be one of: member, maintainer, all.'
required: false
default: all
token:
description: GitHub token
required: true
default: ${{ github.token }}
outputs:
data:
description: Raw member data from GitHub API
value: ${{ steps.get-members.outputs.data }}
members:
description: GitHub logins of team members
value: ${{ steps.members.outputs.members }}
runs:
using: composite
steps:
- name: get-team-members
id: get-members
shell: bash
run: echo ::set-output name=data::$(gh api --paginate -X GET /orgs/$ORG/teams/$TEAM_SLUG/members\?role=$ROLE | jq 'reduce inputs as $i (.; . += $i)')
env:
ORG: ${{ inputs.org }}
TEAM_SLUG: ${{ inputs.team_slug }}
ROLE: ${{ inputs.role }}
GH_TOKEN: ${{ inputs.token }}
- id: members
run: echo '::set-output name=members::${{ join(fromJson(steps.get-members.outputs.data).*.login) }}'
shell: bash