Skip to content

Commit

Permalink
Add membership check
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola committed Sep 24, 2024
1 parent f78d276 commit b1b25c3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Check if comment author is a member of k3s team
uses: actions/github-script@v7
with:
script: |
const org = context.repo.owner;
const team_slug = 'k3s';
const username = context.payload.comment.user.login;
const { data: membership } = await github.teams.getMembershipForUserInOrg({
org,
team_slug,
username
});
if (membership.state !== 'active') {
core.setFailed(`User ${username} is not an active member of the ${team_slug} team`);
}
- name: Checkout PR code
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit b1b25c3

Please sign in to comment.