File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 with :
1616 project-url : https://github.com/orgs/patternfly/projects/7
1717 github-token : ${{ secrets.GH_PROJECTS }}
18+ label-issue :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Check if the author is on the team
22+ id : check_team_membership
23+ uses : actions/github-script@v6
24+ with :
25+ script : |
26+ const org = 'patternfly';
27+ const team_slug = 'frequent-flyers';
28+ const author = context.payload.issue.user.login;
29+
30+ try {
31+ const { data: membership } = await github.teams.getMembershipForUserInOrg({
32+ org: org,
33+ team_slug: team_slug,
34+ username: author
35+ });
36+
37+ if (membership && membership.state === 'active') {
38+ core.setOutput('is_team_member', 'true');
39+ } else {
40+ core.setOutput('is_team_member', 'false');
41+ }
42+ } catch (error) {
43+ // If the user is not a team member, it will throw a 404 error
44+ core.setOutput('is_team_member', 'false');
45+ }
46+
47+ - name : Add label if user is a team member
48+ if : steps.check_team_membership.outputs.is_team_member == 'true'
49+ uses : actions-ecosystem/action-add-labels@v1
50+ with :
51+ github_token : ${{ secrets.GITHUB_TOKEN }}
52+ labels : " frequent-flyer"
You can’t perform that action at this time.
0 commit comments