Skip to content

Commit 6c49b7a

Browse files
committed
Fix pull request permission by using pull_request_target
1 parent f7ecb9e commit 6c49b7a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/build-on-pull-request.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
name: Build FFmpeg on pull request
22
on:
3-
pull_request:
3+
pull_request_target:
44
branches:
55
- main
66
paths-ignore:
77
- README.md
8-
8+
- .github/dependabot.yml
9+
types: [labeled]
10+
911
jobs:
1012
build:
1113
runs-on: ubuntu-20.04
14+
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
1215
strategy:
1316
matrix:
1417
os: [win64, win32]
@@ -18,6 +21,9 @@ jobs:
1821
uses: actions/checkout@v2
1922
with:
2023
submodules: true
24+
ref: ${{ github.event.pull_request.head.ref }}
25+
repository: ${{ github.event.pull_request.head.repo.full_name }}
26+
persist-credentials: false
2127

2228
- name: Install dependencies
2329
run: ./dependencies.sh

.github/workflows/build-on-push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- main
66
paths-ignore:
77
- README.md
8+
- .github/dependabot.yml
9+
- .github/workflows/build-on-pull-request.yml
810

911
jobs:
1012
build:
@@ -18,6 +20,7 @@ jobs:
1820
uses: actions/checkout@v2
1921
with:
2022
submodules: true
23+
persist-credentials: false
2124

2225
- name: Install dependencies
2326
run: ./dependencies.sh

0 commit comments

Comments
 (0)