File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,12 +16,35 @@ concurrency:
1616
1717jobs :
1818 ok-to-test :
19- if : contains(github.event.pull_request.labels.*.name, 'ok-to-test')
19+ if : contains(github.event.pull_request.labels.*.name, 'ok-to-test') || github.event_name == 'pull_request_target'
2020 runs-on : ubuntu-latest
2121 continue-on-error : true
2222
2323 steps :
24+ - name : Check if author is a Kubeflow GitHub member
25+ id : membership-check
26+ uses : actions/github-script@v7
27+ with :
28+ script : |
29+ const username = context.payload.pull_request.user.login;
30+ const org = context.repo.owner;
31+ try {
32+ const res = await github.rest.orgs.checkMembershipForUser({
33+ org,
34+ username
35+ });
36+ core.setOutput("is_member", true);
37+ } catch (error) {
38+ if (error.status === 404) {
39+ // User is not a member
40+ core.setOutput("is_member", false);
41+ } else {
42+ throw error;
43+ }
44+ }
45+
2446 - name : Approve Pending Workflow Runs
47+ if : steps.membership-check.outputs.is_member == 'true' || contains(github.event.pull_request.labels.*.name, 'ok-to-test')
2548 uses : actions/github-script@v7
2649 with :
2750 retries : 3
You can’t perform that action at this time.
0 commit comments