From c68b40a1a47a1a6c4716f1f1a46c55fd792bfe2d Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Thu, 21 Sep 2023 11:25:25 -0700 Subject: [PATCH] Auto label PRs that may require extra checks We would like to automatically run benchcomp if the PR touches some files. Use an auto label action for that. --- .github/labeler.yml | 14 ++++++++++++ .github/workflows/labeler.yml | 30 +++++++++++++++++++++++++ .github/workflows/toolchain-upgrade.yml | 1 - 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000000..07eb164fe021 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,14 @@ +# Copyright Kani Contributors +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# Configuration for auto-labeling PRs +# +# Note that we enable dot, so "**" matches all files in a folder + +Z-BenchCI: + - kani-compiler/** + - rust-toolchain.toml + - kani-dependencies + - kani-driver/src/call-* + - Cargo.lock + diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000000..70f7bf61e36b --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,30 @@ +# Copyright Kani Contributors +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# Auto label PRs based on the files that were changed +# +# This PR runs on `pull_request_target` because it needs extra write permission. +# +# Thus, we keep this workflow minimal, and the only action used here is from a +# verified publisher. +# +# See for more details. + +name: Auto Label +on: pull_request_target + +jobs: + auto-label: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Checkout Kani + uses: actions/checkout@v3 + + - name: Label PR + uses: actions/labeler@v4 + with: + dot: true + diff --git a/.github/workflows/toolchain-upgrade.yml b/.github/workflows/toolchain-upgrade.yml index 2c199161f9e0..8d54ebe189ff 100644 --- a/.github/workflows/toolchain-upgrade.yml +++ b/.github/workflows/toolchain-upgrade.yml @@ -74,7 +74,6 @@ jobs: branch: toolchain-${{ env.next_toolchain_date }} delete-branch: true title: 'Automatic toolchain upgrade to nightly-${{ env.next_toolchain_date }}' - labels: Z-BenchCI body: > Update Rust toolchain from nightly-${{ env.current_toolchain_date }} to nightly-${{ env.next_toolchain_date }} without any other source changes.