Skip to content

Commit

Permalink
Update extensions.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolethoen authored Sep 18, 2024
1 parent 1d2ce59 commit 3d7a33c
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions .github/workflows/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,27 @@ jobs:
steps:
- name: Check if the author is on the team
id: check_team_membership
uses: actions/github-script@v6
with:
script: |
const org = 'patternfly';
const team_slug = 'frequent-flyers';
const author = context.payload.issue.user.login;
run: |
const org = 'patternfly';
const team_slug = 'frequent-flyers';
const author = context.payload.issue.user.login;
try {
const { data: membership } = await github.teams.getMembershipForUserInOrg({
org: org,
team_slug: team_slug,
username: author
});
try {
const { data: membership } = await github.teams.getMembershipForUserInOrg({
org: org,
team_slug: team_slug,
username: author
});
if (membership && membership.state === 'active') {
core.setOutput('is_team_member', 'true');
} else {
core.setOutput('is_team_member', 'false');
}
} catch (error) {
// If the user is not a team member, it will throw a 404 error
if (membership && membership.state === 'active') {
core.setOutput('is_team_member', 'true');
} else {
core.setOutput('is_team_member', 'false');
}
} catch (error) {
// If the user is not a team member, it will throw a 404 error
core.setOutput('is_team_member', 'false');
}
- name: Add label if user is a team member
if: steps.check_team_membership.outputs.is_team_member == 'true'
Expand Down

0 comments on commit 3d7a33c

Please sign in to comment.