Add support for automation/bors/auto merge branch

(cherry picked from commit bbf4ec3b0f)
This commit is contained in:
Jakub Beránek 2025-12-23 15:47:03 +01:00 committed by Josh Stone
parent efcf90104e
commit af53cfa882
2 changed files with 7 additions and 4 deletions

View file

@ -15,6 +15,7 @@ on:
- try - try
- try-perf - try-perf
- automation/bors/try - automation/bors/try
- automation/bors/auto
pull_request: pull_request:
branches: branches:
- "**" - "**"
@ -56,7 +57,7 @@ jobs:
- name: Test citool - name: Test citool
# Only test citool on the auto branch, to reduce latency of the calculate matrix job # Only test citool on the auto branch, to reduce latency of the calculate matrix job
# on PR/try builds. # on PR/try builds.
if: ${{ github.ref == 'refs/heads/auto' }} if: ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto' }}
run: | run: |
cd src/ci/citool cd src/ci/citool
CARGO_INCREMENTAL=0 cargo test CARGO_INCREMENTAL=0 cargo test
@ -79,7 +80,7 @@ jobs:
# access the environment. # access the environment.
# #
# We only enable the environment for the rust-lang/rust repository, so that CI works on forks. # We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }} environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
env: env:
CI_JOB_NAME: ${{ matrix.name }} CI_JOB_NAME: ${{ matrix.name }}
CI_JOB_DOC_URL: ${{ matrix.doc_url }} CI_JOB_DOC_URL: ${{ matrix.doc_url }}
@ -313,7 +314,7 @@ jobs:
needs: [ calculate_matrix, job ] needs: [ calculate_matrix, job ]
# !cancelled() executes the job regardless of whether the previous jobs passed or failed # !cancelled() executes the job regardless of whether the previous jobs passed or failed
if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }} if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto')) && 'bors') || '' }} environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
steps: steps:
- name: checkout the source code - name: checkout the source code
uses: actions/checkout@v5 uses: actions/checkout@v5

View file

@ -46,7 +46,9 @@ impl GitHubContext {
let patterns = if !patterns.is_empty() { Some(patterns) } else { None }; let patterns = if !patterns.is_empty() { Some(patterns) } else { None };
Some(RunType::TryJob { job_patterns: patterns }) Some(RunType::TryJob { job_patterns: patterns })
} }
("push", "refs/heads/auto") => Some(RunType::AutoJob), ("push", "refs/heads/auto" | "refs/heads/automation/bors/auto") => {
Some(RunType::AutoJob)
}
("push", "refs/heads/main") => Some(RunType::MainJob), ("push", "refs/heads/main") => Some(RunType::MainJob),
_ => None, _ => None,
} }