From 6f4da9a5d2b30b561bd96d62b90c8453e6ceb383 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 9 Feb 2021 02:00:53 +0000 Subject: [PATCH] Check that pull requests target unstable (#2187) Attempt to prevent accidental merges to `stable` due to GitHub's default behaviour of opening PRs against it. I've intentionally opened this PR against `stable` to test the functionality ;) --- .github/workflows/test-suite.yml | 7 +++++++ bors.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 35dc8471a..04903d3c6 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -12,6 +12,13 @@ env: # Deny warnings in CI RUSTFLAGS: "-D warnings" jobs: + target-branch-check: + name: target-branch-check + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Check that pull request is targeting unstable branch + run: test ${{ github.base_ref }} = "unstable" cargo-fmt: name: cargo-fmt runs-on: ubuntu-latest diff --git a/bors.toml b/bors.toml index b7ce82b61..e12684e87 100644 --- a/bors.toml +++ b/bors.toml @@ -16,4 +16,4 @@ status = [ ] use_squash_merge = true timeout_sec = 7200 -pr_status = ["license/cla"] +pr_status = ["license/cla", "target-branch-check"]