Skip to content

Commit 0697e68

Browse files
[CI] Don't restrict pre-commit for PRs from inside the repo (#10442)
If the PR's source branch is already inside `origin` then it is known to be safe.
1 parent 18f23b0 commit 0697e68

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/sycl_precommit_linux.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
lint:
3030
needs: [detect_changes]
3131
if: |
32+
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
3233
!contains(needs.detect_changes.outputs.filters, 'ci')
3334
runs-on: [Linux, build]
3435
container:
@@ -62,6 +63,7 @@ jobs:
6263
test_matrix:
6364
needs: [detect_changes]
6465
if: |
66+
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
6567
!contains(needs.detect_changes.outputs.filters, 'ci')
6668
name: Generate Test Matrix
6769
uses: ./.github/workflows/sycl_gen_test_matrix.yml
@@ -77,7 +79,8 @@ jobs:
7779
if: |
7880
always()
7981
&& (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
80-
&& !contains(needs.detect_changes.outputs.filters, 'ci')
82+
&& (github.event.pull_request.head.repo.full_name == 'intel/llvm'
83+
|| !contains(needs.detect_changes.outputs.filters, 'ci'))
8184
uses: ./.github/workflows/sycl_linux_build_and_test.yml
8285
secrets: inherit
8386
with:

.github/workflows/sycl_precommit_windows.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
lint:
3030
needs: [detect_changes]
3131
if: |
32+
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
3233
!contains(needs.detect_changes.outputs.filters, 'ci')
3334
runs-on: [Linux, build]
3435
container:
@@ -62,6 +63,7 @@ jobs:
6263
test_matrix:
6364
needs: [detect_changes]
6465
if: |
66+
github.event.pull_request.head.repo.full_name == 'intel/llvm' ||
6567
!contains(needs.detect_changes.outputs.filters, 'ci')
6668
name: Generate Test Matrix
6769
uses: ./.github/workflows/sycl_gen_test_matrix.yml
@@ -76,7 +78,8 @@ jobs:
7678
always()
7779
&& (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
7880
&& github.repository == 'intel/llvm'
79-
&& !contains(needs.detect_changes.outputs.filters, 'ci')
81+
&& (github.event.pull_request.head.repo.full_name == 'intel/llvm'
82+
|| !contains(needs.detect_changes.outputs.filters, 'ci'))
8083
uses: ./.github/workflows/sycl_windows_build_and_test.yml
8184
with:
8285
lts_matrix: ${{ needs.test_matrix.outputs.lts_wn_matrix }}

0 commit comments

Comments
 (0)