Skip to content

Commit 6f58f30

Browse files
authored
Rollup merge of #141323 - Kobzol:bors-environment, r=marcoieni
Add bors environment to CI This will be used to access secrets once we move off rust-lang-ci. The PR configures the environment: - Only for `rust-lang/rust`, so that it doesn't affect `rust-lang-ci/rust` before we switch (we can remove this condition later, but the environment likely won't work for forks anyway, so we might as well just keep it to make fork CI work) - Only for the `try`/`auto` branches, so that PR CI still works. Context: rust-lang/infra-team#188 r? `@marcoieni`
2 parents 981bbf4 + 78d3ea1 commit 6f58f30

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ jobs:
7373
needs: [ calculate_matrix ]
7474
runs-on: "${{ matrix.os }}"
7575
timeout-minutes: 360
76+
# The bors environment contains secrets required for elevated workflows (try and auto builds),
77+
# which need to access e.g. S3 and upload artifacts. We want to provide access to that
78+
# environment only on the try/auto branches, which are only accessible to bors.
79+
# This also ensures that PR CI (which doesn't get write access to S3) works, as it cannot
80+
# access the environment.
81+
#
82+
# We only enable the environment for the rust-lang/rust repository, so that rust-lang-ci/rust
83+
# CI works until we migrate off it (since that repository doesn't contain the environment).
84+
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }}
7685
env:
7786
CI_JOB_NAME: ${{ matrix.name }}
7887
CI_JOB_DOC_URL: ${{ matrix.doc_url }}

0 commit comments

Comments
 (0)