Skip to content

Commit 2fc95f5

Browse files
committed
ci: Convert to pull_request_target
This commit converts the CI workflow to trigger on the `pull_request_target` instead of `pull_request`, in order to allow accessing secrets in the workflow. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 2cc1aed commit 2fc95f5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: CI
55
on:
66
push:
77
branches: [ main ]
8-
pull_request:
8+
pull_request_target:
99
branches: [ main ]
1010
workflow_call:
1111
workflow_dispatch:
@@ -51,7 +51,7 @@ on:
5151
- xtensa-sample_controller_zephyr-elf
5252

5353
concurrency:
54-
group: ${{ github.event_name == 'workflow_dispatch' && github.run_id || github.ref }}
54+
group: ${{ github.event_name == 'workflow_dispatch' && github.run_id || github.head_ref || github.ref }}
5555
cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }}
5656

5757
env:
@@ -75,6 +75,7 @@ jobs:
7575
uses: actions/checkout@v2
7676
with:
7777
fetch-depth: 0
78+
persist-credentials: false
7879

7980
- name: Generate version file
8081
run: |
@@ -91,7 +92,7 @@ jobs:
9192
id: generate-matrix
9293
run: |
9394
# Set build configurations
94-
if [ "${{ github.event_name }}" == "pull_request" ]; then
95+
if [ "${{ github.event_name }}" == "pull_request_target" ]; then
9596
# Set configurations based on the pull request labels
9697
${{ contains(github.event.pull_request.labels.*.name, 'ci-linux-x86_64') }} && build_host_linux_x86_64="y"
9798
${{ contains(github.event.pull_request.labels.*.name, 'ci-linux-aarch64') }} && build_host_linux_aarch64="y"
@@ -481,6 +482,7 @@ jobs:
481482
uses: actions/checkout@v2
482483
with:
483484
submodules: recursive
485+
persist-credentials: false
484486

485487
- name: Build crosstool-ng
486488
run: |
@@ -757,6 +759,7 @@ jobs:
757759
uses: actions/checkout@v2
758760
with:
759761
submodules: recursive
762+
persist-credentials: false
760763

761764
- name: Build Linux host tools
762765
if: startsWith(matrix.host.name, 'linux-')
@@ -857,6 +860,8 @@ jobs:
857860
858861
- name: Check out source code
859862
uses: actions/checkout@v2
863+
with:
864+
persist-credentials: false
860865

861866
- name: Build CMake package
862867
run: |
@@ -938,6 +943,7 @@ jobs:
938943
uses: actions/checkout@v2
939944
with:
940945
path: repository
946+
persist-credentials: false
941947

942948
- name: Download artifacts
943949
uses: actions/download-artifact@v2

0 commit comments

Comments
 (0)