From 818761f608a5117525b945a54f96fe6d013b896b Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 9 Nov 2026 11:38:55 +1300 Subject: [PATCH] Check license headers in pull requests. Require base-project 0.1.8 in the private `bake/` package and lock bake-license 0.2.9, which adds the `license:check` task, and bake-test 0.3.7; add the canonical `license` job to the test workflow and require it in the `test-result` aggregate, so a missing or stale license header fails the pull request that introduces it instead of changing sources in a release. The headers are already current. --- .github/workflows/test.yml | 19 ++++++++++++++++++- Cargo.lock | 16 ++++++++-------- bake/Cargo.toml | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 521b0bd..62c2912 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,9 +52,26 @@ jobs: packages=$(cargo metadata --no-deps --format-version 1 --locked | jq -r '.packages[] | select(.publish != []) | "--package=\(.name)"') cargo check $packages --all-targets --locked + license: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + with: + # Copyright lines come from the full history of the commits under review, not of GitHub's merge commit. + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + - uses: actions-rust-lang/setup-rust-toolchain@v2 + with: + cache-shared-key: license-bake-launcher-v1 + - name: Install Bake launcher + run: cargo install bake --locked + - name: Check license files and Rust source headers + run: cargo bake --locked license:check + test-result: if: always() - needs: [test, minimum-rust] + needs: [test, minimum-rust, license] runs-on: ubuntu-latest timeout-minutes: 5 steps: diff --git a/Cargo.lock b/Cargo.lock index fde8cf5..69ebb56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "bake-license" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f70e25afc0b76e54a37fbc873430e0add234b4f73c105b70c24fe4cb6036b4fc" +checksum = "d8a01c45b9fa4ca38fdb23c6f20359420d069a9c189055f445f38f45cdd121c9" dependencies = [ "bake", "base-markdown", @@ -124,9 +124,9 @@ dependencies = [ [[package]] name = "bake-test" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86defb1a5874835378e27f3be338302ef363352b1d3ea9352690a45fdbc27729" +checksum = "48d41c9dc36d460ea2d920eca6cdc5f1178f515ce2a85f9aa6b58cd3e27781d2" dependencies = [ "bake", "serde_json", @@ -162,18 +162,18 @@ checksum = "46f2f8db06d87ff80f4f96e56336afcb338b96b444ee8de7fe8919601e8de9b9" [[package]] name = "base-markdown" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7499a30b34b90b641e5c81b2f9c012ef3e1335e497fcca932d59a4fa3d845b61" +checksum = "334406e57d351a23d04bb1dc8804ebb25545f9aabe51a6d8ed87122f6a310453" dependencies = [ "memchr", ] [[package]] name = "base-project" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17105821bc688644e3193269a7e2c005a53f44b16981094e0771f802f8eb1e1e" +checksum = "dea130e6165e2833d9f1d2ca90bdae6246001abb19b525f7ba92f2e142bc1b1b" dependencies = [ "bake", "bake-agent-context", diff --git a/bake/Cargo.toml b/bake/Cargo.toml index c233ab8..340c005 100644 --- a/bake/Cargo.toml +++ b/bake/Cargo.toml @@ -6,5 +6,5 @@ publish = false [dependencies] bake = ">=0.20, <1" -base-project = ">=0.1.7" +base-project = ">=0.1.8"