Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3a268acb
Unverified
Commit
3a268acb
authored
Sep 24, 2024
by
Derek Nola
Committed by
GitHub
Sep 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check k3s-io organization membership not team membership for trivy scans (#10940)
Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
6731f4a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
trivy.yaml
.github/workflows/trivy.yaml
+13
-10
No files found.
.github/workflows/trivy.yaml
View file @
3a268acb
...
...
@@ -14,19 +14,20 @@ jobs:
-
name
:
Check if comment author is a member of k3s-dev team
uses
:
actions/github-script@v7
with
:
# Catch 404 errors if user is not a member of the organization
# 302 is expected as the GHA is not a member of the organization
# Users must be set their membership to public for this to work
# https://github.com/orgs/k3s-io/people
script
:
|
const org = context.repo.owner;
const team_slug = 'k3s-dev';
const username = context.payload.comment.user.login;
const { data: membership } = await github.rest.teams.getMembershipForUserInOrg({
org,
team_slug,
username
});
if (membership.state !== 'active') {
core.setFailed(`User ${username} is not an active member of the ${team_slug} team`);
try {
const result = await github.rest.orgs.checkMembershipForUser({
org,
username,
});
} catch (error) {
core.setFailed(`User ${username} is not an public member of the ${org} organization`);
}
-
name
:
Checkout PR code
uses
:
actions/checkout@v4
...
...
@@ -87,6 +88,8 @@ jobs:
if
:
always() && needs.trivy_scan.result == 'failure'
permissions
:
pull-requests
:
write
env
:
GH_TOKEN
:
${{ github.token }}
steps
:
-
name
:
Report Failure
run
:
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment