Skip to content

Commit 4ce1d53

Browse files
committed
Pass secrets to approved workflows
1 parent ef17e01 commit 4ce1d53

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/run-tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
name: Run tests
22

33
on:
4-
pull_request:
4+
pull_request_target:
5+
types: [opened, synchronize]
56
schedule:
67
- cron: '0 0 * * *'
78

89
jobs:
9-
php-tests:
10+
access_check:
1011
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check user permissions
14+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' }}
15+
run: |
16+
echo "Action was not triggered by an organization member. Exiting now."
17+
exit 1
1118
19+
php-tests:
20+
runs-on: ubuntu-latest
21+
needs: access_check
1222
strategy:
1323
matrix:
1424
db: ['mysql', 'pgsql']
@@ -32,7 +42,9 @@ jobs:
3242

3343
steps:
3444
- name: Checkout code
35-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
46+
with:
47+
ref: ${{ github.event.pull_request.head.sha }}
3648

3749
- name: Setup PHP
3850
uses: shivammathur/setup-php@v2

0 commit comments

Comments
 (0)