Skip to content

Commit 5a2a48b

Browse files
update CI so that we share screts when PR is approved
1 parent e00e609 commit 5a2a48b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/test-app.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,27 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
branches:
9-
- main
7+
pull_request_target:
8+
types: [opened, synchronize]
109

1110
jobs:
11+
access_check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check user permissions
15+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' }}
16+
run: |
17+
echo "Action was not triggered by an organization member. Exiting now."
18+
exit 1
19+
1220
cypress-run:
1321
runs-on: ubuntu-latest
22+
needs: access_check
1423
steps:
1524
- name: Checkout
1625
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha }}
1728

1829
- name: Cypress run
1930
uses: cypress-io/github-action@v6
@@ -25,4 +36,3 @@ jobs:
2536
env:
2637
NEXT_PUBLIC_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"
2738
CYPRESS_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"
28-

0 commit comments

Comments
 (0)