Skip to content

Commit 23be760

Browse files
authored
Merge pull request #1743 from Kobzol/dry-run-branch
Run dry-run with code from PR if it is not from a fork
2 parents e38bc9a + f6890b5 commit 23be760

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/dry-run.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333
with:
34-
# Always checkout the master branch to avoid checking out
35-
# code of untrusted PRs.
36-
# This might break the dry-run if code or schema modifications
37-
# are performed, we can selectively allow that in the future
38-
# e.g. if the author of the PR is trusted.
39-
ref: 'master'
34+
# If the PR is from this repository, checkout the PR sha,
35+
# so that we can also test code changes.
36+
# If it is from a fork, then always checkout the 'master' branch,
37+
# to avoid checking out code of untrusted PRs.
38+
ref: ${{ github.event.workflow_run.head_repository.full_name != 'rust-lang/team' && 'master' || github.event.workflow_run.head_sha }}
4039
persist-credentials: false
4140

4241
- name: Install Rust Stable

0 commit comments

Comments
 (0)