Skip to content

Commit 8b4e60f

Browse files
hudeng-goBLumia
authored andcommitted
fix: add allow-unsafe-pr-checkout: true to checkout steps
When checking out from fork repos, the allow-unsafe-pr-checkout option must be set to true to allow actions/checkout to fetch from the fork repository.
1 parent 10499fb commit 8b4e60f

6 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/auto-tag.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
with:
2121
ref: ${{ github.event.pull_request.head.sha }}
2222
repository: ${{ github.event.pull_request.head.repo.full_name }}
23+
allow-unsafe-pr-checkout: true
2324
persist-credentials: false
2425
- name: get changelog version
2526
id: get-version

.github/workflows/build-distribution.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
with:
2828
ref: ${{ github.event.pull_request.head.sha }}
2929
repository: ${{ github.event.pull_request.head.repo.full_name }}
30+
allow-unsafe-pr-checkout: true
3031
- uses: actions/checkout@v7
3132
if: ${{ github.event_name == 'push' }}
3233
with:
@@ -68,6 +69,7 @@ jobs:
6869
with:
6970
ref: ${{ github.event.pull_request.head.sha }}
7071
repository: ${{ github.event.pull_request.head.repo.full_name }}
72+
allow-unsafe-pr-checkout: true
7173
- uses: actions/checkout@v7
7274
if: ${{ github.event_name == 'push' }}
7375
with:
@@ -164,6 +166,7 @@ jobs:
164166
with:
165167
ref: ${{ github.event.pull_request.head.sha }}
166168
repository: ${{ github.event.pull_request.head.repo.full_name }}
169+
allow-unsafe-pr-checkout: true
167170
- uses: actions/checkout@v7
168171
if: ${{ github.event_name == 'push' }}
169172
with:
@@ -369,6 +372,7 @@ jobs:
369372
with:
370373
ref: ${{ github.event.pull_request.head.sha }}
371374
repository: ${{ github.event.pull_request.head.repo.full_name }}
375+
allow-unsafe-pr-checkout: true
372376
- uses: actions/checkout@v7
373377
if: ${{ github.event_name == 'push' }}
374378
with:

.github/workflows/commitlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
with:
1212
ref: ${{ github.event.pull_request.head.sha }}
1313
repository: ${{ github.event.pull_request.head.repo.full_name }}
14+
allow-unsafe-pr-checkout: true
1415
fetch-depth: 0
1516

1617
- name: check PR description for AI co-author pattern

.github/workflows/doc-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
with:
6262
ref: ${{ github.event.pull_request.head.sha }}
6363
repository: ${{ github.event.pull_request.head.repo.full_name }}
64+
allow-unsafe-pr-checkout: true
6465
persist-credentials: false
6566

6667
- uses: linuxdeepin/action-doxygencheck@master

.github/workflows/dtk-unittest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
with:
2626
ref: ${{ github.event.pull_request.head.sha }}
2727
repository: ${{ github.event.pull_request.head.repo.full_name }}
28+
allow-unsafe-pr-checkout: true
2829
- uses: actions/checkout@v7
2930
if: ${{ github.event_name == 'push' }}
3031

.github/workflows/license-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
fetch-depth: 0
1212
ref: ${{ github.event.pull_request.head.sha }}
1313
repository: ${{ github.event.pull_request.head.repo.full_name }}
14+
allow-unsafe-pr-checkout: true
1415

1516
- name: Setup Python
1617
id: python
@@ -118,6 +119,7 @@ jobs:
118119
with:
119120
ref: ${{ github.event.pull_request.head.sha }}
120121
repository: ${{ github.event.pull_request.head.repo.full_name }}
122+
allow-unsafe-pr-checkout: true
121123
- name: Install zsh
122124
run: |
123125
sudo sed -i 's/azure.archive.ubuntu.com/mirrors.layeronline.com/g' /etc/apt/sources.list
@@ -150,6 +152,7 @@ jobs:
150152
fetch-depth: 0
151153
ref: ${{ github.event.pull_request.head.sha }}
152154
repository: ${{ github.event.pull_request.head.repo.full_name }}
155+
allow-unsafe-pr-checkout: true
153156
- uses: zccrs/github-actions-spdx-checker@main
154157
with:
155158
include: '*.py,*.js,*.jsx,*.tsx,*.java,*.cpp,*.c,*.h,*.hpp,*.go,*.rs,*.rb,*.php,*.sh,*.xml,*.yaml,*.yml,*.qml,CMakeLists.txt,Makefile'

0 commit comments

Comments
 (0)