Skip to content

Commit d861737

Browse files
drzrafRaphaël Droz
and
Raphaël Droz
authored
ci: Ensure tj-actions/changed-files works with pull_request_target (#366)
Co-authored-by: Raphaël Droz <[email protected]>
1 parent 5fce9a4 commit d861737

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/actions.yml

+18
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,32 @@ name: "CI"
22

33
on:
44
pull_request_target:
5+
types: [opened, synchronize, reopened]
56
push:
67
branches:
78
- 'v3'
89
- 'feature/*'
910
- 'fix/*'
1011
workflow_dispatch:
1112

13+
permissions:
14+
actions: read
15+
checks: write
16+
contents: read
17+
deployments: read
18+
issues: read
19+
packages: read
20+
pull-requests: write
21+
repository-projects: read
22+
security-events: read
23+
statuses: write
24+
1225
env:
1326
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
1427
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
1528
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
1629
DISPLAY: ':99.0'
30+
1731
jobs:
1832
approve:
1933
runs-on: ubuntu-latest
@@ -31,15 +45,19 @@ jobs:
3145
with:
3246
ref: ${{ github.event.pull_request.head.sha }}
3347
fetch-depth: 2
48+
persist-credentials: false
3449

3550
- name: Is environment ok
3651
run: |
3752
echo $SAUCE_USERNAME
53+
echo ${{ github.event.pull_request.base.sha }} ${{ github.sha }} ${{ github.event.pull_request.head.sha }}
3854
3955
- name: Get specific changed files
4056
id: source-changed
4157
uses: tj-actions/[email protected]
4258
with:
59+
base_sha: ${{ github.sha }}
60+
sha: ${{ github.event.pull_request.head.sha }}
4361
files: |
4462
src
4563
test

0 commit comments

Comments
 (0)