Skip to content

Commit 524d806

Browse files
committed
Auto merge of rust-lang#127312 - Kobzol:ci-org-agnostic, r=jdno
Make CI more agnostic of the owning GitHub organization This should make it possible to switch running `auto` and `try` builds from `rust-lang-ci` to `rust-lang`. r? `@jdno`
2 parents 6e27807 + 410f760 commit 524d806

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/ci/docker/run.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then
9393
docker --version
9494

9595
REGISTRY=ghcr.io
96-
# PR CI runs on rust-lang, but we want to use the cache from rust-lang-ci
97-
REGISTRY_USERNAME=rust-lang-ci
96+
REGISTRY_USERNAME=${GITHUB_REPOSITORY_OWNER}
9897
# Tag used to push the final Docker image, so that it can be pulled by e.g. rustup
9998
IMAGE_TAG=${REGISTRY}/${REGISTRY_USERNAME}/rust-ci:${cksum}
10099
# Tag used to cache the Docker build

src/ci/github-actions/calculate-job-matrix.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,17 @@ def find_run_type(ctx: GitHubCtx) -> Optional[WorkflowRunType]:
9191
if ctx.event_name == "pull_request":
9292
return PRRunType()
9393
elif ctx.event_name == "push":
94-
old_bors_try_build = (
95-
ctx.ref in ("refs/heads/try", "refs/heads/try-perf") and
96-
ctx.repository == "rust-lang-ci/rust"
94+
try_build = ctx.ref in (
95+
"refs/heads/try",
96+
"refs/heads/try-perf",
97+
"refs/heads/automation/bors/try"
9798
)
98-
new_bors_try_build = (
99-
ctx.ref == "refs/heads/automation/bors/try" and
100-
ctx.repository == "rust-lang/rust"
101-
)
102-
try_build = old_bors_try_build or new_bors_try_build
10399

104100
if try_build:
105101
jobs = get_custom_jobs(ctx)
106102
return TryRunType(custom_jobs=jobs)
107103

108-
if ctx.ref == "refs/heads/auto" and ctx.repository == "rust-lang-ci/rust":
104+
if ctx.ref == "refs/heads/auto":
109105
return AutoRunType()
110106

111107
return None

0 commit comments

Comments
 (0)