File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,8 +37,33 @@ concurrency:
3737 cancel-in-progress : true
3838
3939jobs :
40+ permissions-check :
41+ name : Check Permissions
42+ runs-on : ' blacksmith-8vcpu-ubuntu-2204'
43+ steps :
44+ - name : Check org membership
45+ uses : actions/github-script@v7
46+ with :
47+ script : |
48+ const org = context.repo.owner;
49+ const username = context.actor;
50+
51+ try {
52+ const { status } = await github.rest.orgs.checkMembershipForUser({
53+ org,
54+ username,
55+ });
56+
57+ if (status !== 204) {
58+ core.setFailed(`User '${username}' is not a member of the '${org}' organization.`);
59+ }
60+ } catch (error) {
61+ core.setFailed(`User '${username}' is not a member of the '${org}' organization.`);
62+ }
63+
4064 validate-instances :
4165 name : Validate Staging Instances
66+ needs : [permissions-check]
4267 runs-on : ' blacksmith-8vcpu-ubuntu-2204'
4368 steps :
4469 - name : Checkout Repo
5681
5782 integration-tests :
5883 name : Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }})
84+ needs : [permissions-check]
5985 runs-on : ' blacksmith-8vcpu-ubuntu-2204'
6086 defaults :
6187 run :
You can’t perform that action at this time.
0 commit comments