Skip to content

Commit c053ab5

Browse files
committed
github actions: Github docs suggest pull_request_target
https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target Suggests using pull_request_target for forked repository workflows.
1 parent 369d0f6 commit c053ab5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/process-pull-request.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name: Pull Request Checker
77

88
on:
9-
pull_request:
9+
pull_request_target:
1010
branches:
1111
- '**'
1212
- '!mainline'
@@ -39,7 +39,9 @@ jobs:
3939
/usr/bin/pip3 install gitPython
4040
python -c "import sys; import git; print(sys.version)"
4141
git fetch origin ${{ github.base_ref }}
42-
git fetch origin ${{ github.head_ref }}
42+
if ! git fetch origin ${{ github.head_ref }}; then
43+
echo "Unable to checkout ${{ github.head_ref }}"
44+
fi
4345
git remote add linux https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
4446
git fetch --shallow-since="3 years ago" linux
4547
echo "Will run process-git-request.rb with:"

0 commit comments

Comments
 (0)