From b9d4e69ddde7d0df5fef6e4c927eefbfd3569e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Kecskem=C3=A9ty?= Date: Sun, 15 Nov 2026 03:06:51 +0100 Subject: [PATCH 1/4] Read the licence policy from main instead of the pinned release --- .github/dependency-review.yml | 14 ++++++++++++++ .github/workflows/shared-checks.yml | 16 ++++------------ CLAUDE.md | 2 +- README.md | 2 +- docs/workflows.md | 4 ++-- 5 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 .github/dependency-review.yml diff --git a/.github/dependency-review.yml b/.github/dependency-review.yml new file mode 100644 index 0000000..3e267ab --- /dev/null +++ b/.github/dependency-review.yml @@ -0,0 +1,14 @@ +# Read from main by every caller of shared-checks.yml: a change applies to their next run without a release. + +# Every dependency's licence may be combined with GPL-3.0 code that is distributed (public Docker images). +# Missing on purpose, so they fail and need a decision: AGPL-3.0, proprietary and source-available +# licences, non-commercial ones, and GPL-incompatible copyleft (EPL, CDDL, GPL-2.0-only). +# LicenseRef-scancode-protobuf is ScanCode's ID for protobuf's licence: BSD-3-Clause plus a note on generated code. +allow-licenses: >- + MIT, MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Zlib, BSL-1.0, Unlicense, CC0-1.0, + WTFPL, BlueOak-1.0.0, Python-2.0, PSF-2.0, Artistic-2.0, Unicode-3.0, Unicode-DFS-2016, HPND-Markus-Kuhn, + BSD-2-Clause-Views, + MPL-2.0, LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-only, LGPL-3.0-or-later, + GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later, + CC-BY-3.0, CC-BY-4.0, OFL-1.1, + LicenseRef-scancode-protobuf diff --git a/.github/workflows/shared-checks.yml b/.github/workflows/shared-checks.yml index b182e84..70ddff5 100644 --- a/.github/workflows/shared-checks.yml +++ b/.github/workflows/shared-checks.yml @@ -36,15 +36,7 @@ jobs: - name: Review dependency changes uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 with: - # Every dependency's licence may be combined with GPL-3.0 code that is distributed (public Docker images). - # Missing on purpose, so they fail and need a decision: AGPL-3.0, proprietary and source-available - # licences, non-commercial ones, and GPL-incompatible copyleft (EPL, CDDL, GPL-2.0-only). - # LicenseRef-scancode-protobuf is ScanCode's ID for protobuf's licence: BSD-3-Clause plus a note on generated code. - allow-licenses: >- - MIT, MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Zlib, BSL-1.0, Unlicense, CC0-1.0, - WTFPL, BlueOak-1.0.0, Python-2.0, PSF-2.0, Artistic-2.0, Unicode-3.0, Unicode-DFS-2016, HPND-Markus-Kuhn, - BSD-2-Clause-Views, - MPL-2.0, LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-only, LGPL-3.0-or-later, - GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later, - CC-BY-3.0, CC-BY-4.0, OFL-1.1, - LicenseRef-scancode-protobuf + # The licence policy applies to every caller from main, without a release. + config-file: BSStudio/.github/.github/dependency-review.yml@main + # The file is public, but unauthenticated requests share the runner's per-IP rate limit. + external-repo-token: ${{ github.token }} diff --git a/CLAUDE.md b/CLAUDE.md index 2965d4a..1cf2b53 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,5 +19,5 @@ Commit messages and PR titles are plain imperative sentences. PRs are squash-mer - Live GitHub settings change only when asked: `scripts/apply-settings.mjs` and `scripts/apply-ruleset.mjs` write to the organisation's repos, so otherwise run them with `--dry-run` only. - A repo added to `settings/repos.json` also needs the "BSStudio settings check" GitHub App installed on it, which you can't do: tell the user. - `docs/workflows.md` and `scripts/workflow-style.mjs` stay in step: a change to the convention goes in together with the checker change that enforces it. -- A change to the shared checks reaches other repos only through a release: callers pin `shared-checks.yml` by the release commit's SHA with a `# vX.Y.Z` comment, and Renovate opens a PR in each caller for the new pin. The job names (`Workflows`, `Dependencies`) and the `dependency-review` input are an interface: every repo's ruleset requires `Checks / Workflows` by name, so renaming either blocks those PRs until every caller and ruleset is updated. +- A change to the shared checks reaches other repos only through a release: callers pin `shared-checks.yml` by the release commit's SHA with a `# vX.Y.Z` comment, and Renovate opens a PR in each caller for the new pin. The exception is the licence policy, `.github/dependency-review.yml`: every caller reads it from `main`, so a change applies to every repo as soon as it merges, and it keeps its path while any release still references it. The job names (`Workflows`, `Dependencies`) and the `dependency-review` input are an interface: every repo's ruleset requires `Checks / Workflows` by name, so renaming either blocks those PRs until every caller and ruleset is updated. - Files in `assets/` keep their paths: other repos' READMEs embed them from `https://raw.githubusercontent.com/BSStudio/.github/main/assets/`. diff --git a/README.md b/README.md index 7788631..e458afa 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,4 @@ Security features (secret scanning, push protection, Dependabot alerts, CodeQL d Every workflow follows one convention, written down in [`docs/workflows.md`](docs/workflows.md). Each repo enforces it with a `.github/workflows/checks.yml` that calls `.github/workflows/shared-checks.yml` here (the copyable caller is in the convention): `Checks / Workflows` runs actionlint, zizmor and `scripts/check-workflows.mjs` over the repo's workflows and composite actions, and `Checks / Dependencies` reviews new dependencies for vulnerabilities and licences in repos that turn it on. Wherever a ruleset exists it requires `Checks / Workflows`, plus `Checks / Dependencies` where the review is on. -Callers pin a tagged release of this repo; Renovate proposes each new release. The checks run from the same commit as the workflow that calls them: `shared-checks.yml` reaches its composite action through the `$/` self-repository syntax. +Callers pin a tagged release of this repo; Renovate proposes each new release. The licence policy in `.github/dependency-review.yml` is the exception: `Checks / Dependencies` reads it from `main`, so allowing a licence or exempting a package needs no release. The checks run from the same commit as the workflow that calls them: `shared-checks.yml` reaches its composite action through the `$/` self-repository syntax. diff --git a/docs/workflows.md b/docs/workflows.md index e7068af..05e6fb1 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -75,8 +75,8 @@ jobs: ``` - The job must be named `Checks`: the checks then report as `Checks / Workflows` and `Checks / Dependencies`, the names the repository's ruleset requires. -- `dependency-review: true` adds the dependency review for repositories with package manifests. It works on public repositories only and checks every new or changed dependency for known vulnerabilities and for a licence outside the allow-list in `shared-checks.yml`. Without the input the `Dependencies` job is skipped, which still satisfies a required check. -- The pin follows this repository's releases: Renovate proposes each new release in every caller, and that pull request runs the new checks against the repository before anything merges. +- `dependency-review: true` adds the dependency review for repositories with package manifests. It works on public repositories only and checks every new or changed dependency for known vulnerabilities and for a licence outside the licence policy in `.github/dependency-review.yml`. Without the input the `Dependencies` job is skipped, which still satisfies a required check. +- The pin follows this repository's releases: Renovate proposes each new release in every caller, and that pull request runs the new checks against the repository before anything merges. The licence policy is the exception: every caller reads it from this repository's `main`, so a change to it applies on the next run, and re-running a failed `Checks / Dependencies` picks it up. ## Running the checks locally From 113fdde9e9179837bc4007ea7f30c4812308e0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Kecskem=C3=A9ty?= Date: Sun, 15 Nov 2026 03:16:46 +0100 Subject: [PATCH 2/4] Exempt the Sentry CLI from the licence check --- .github/dependency-review.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependency-review.yml b/.github/dependency-review.yml index 3e267ab..6e595de 100644 --- a/.github/dependency-review.yml +++ b/.github/dependency-review.yml @@ -12,3 +12,8 @@ allow-licenses: >- GPL-2.0-or-later, GPL-3.0-only, GPL-3.0-or-later, CC-BY-3.0, CC-BY-4.0, OFL-1.1, LicenseRef-scancode-protobuf + +# Packages whose licence the policy excludes but whose use here it permits, matched by name across all versions. +allow-dependencies-licenses: + # FSL-1.1-Apache-2.0 forbids only competing with Sentry. The Sentry CLI, run by @sentry/bundler-plugins at build time. + - pkg:npm/sentry From 9802429b9cef5c1c1cb9abbf244ca3b2630db8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Kecskem=C3=A9ty?= Date: Sun, 15 Nov 2026 03:32:24 +0100 Subject: [PATCH 3/4] Tighten the licence policy comments --- .github/dependency-review.yml | 4 ++-- .github/workflows/shared-checks.yml | 1 - CLAUDE.md | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/dependency-review.yml b/.github/dependency-review.yml index 6e595de..1ce12ce 100644 --- a/.github/dependency-review.yml +++ b/.github/dependency-review.yml @@ -1,4 +1,4 @@ -# Read from main by every caller of shared-checks.yml: a change applies to their next run without a release. +# Read from main by every caller of shared-checks.yml. # Every dependency's licence may be combined with GPL-3.0 code that is distributed (public Docker images). # Missing on purpose, so they fail and need a decision: AGPL-3.0, proprietary and source-available @@ -15,5 +15,5 @@ allow-licenses: >- # Packages whose licence the policy excludes but whose use here it permits, matched by name across all versions. allow-dependencies-licenses: - # FSL-1.1-Apache-2.0 forbids only competing with Sentry. The Sentry CLI, run by @sentry/bundler-plugins at build time. + # FSL-1.1-Apache-2.0 forbids only competing with Sentry. Build-time CLI of @sentry/bundler-plugins: no image may ship it. - pkg:npm/sentry diff --git a/.github/workflows/shared-checks.yml b/.github/workflows/shared-checks.yml index 70ddff5..9ad04be 100644 --- a/.github/workflows/shared-checks.yml +++ b/.github/workflows/shared-checks.yml @@ -36,7 +36,6 @@ jobs: - name: Review dependency changes uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 with: - # The licence policy applies to every caller from main, without a release. config-file: BSStudio/.github/.github/dependency-review.yml@main # The file is public, but unauthenticated requests share the runner's per-IP rate limit. external-repo-token: ${{ github.token }} diff --git a/CLAUDE.md b/CLAUDE.md index 1cf2b53..bfd9728 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,5 +19,5 @@ Commit messages and PR titles are plain imperative sentences. PRs are squash-mer - Live GitHub settings change only when asked: `scripts/apply-settings.mjs` and `scripts/apply-ruleset.mjs` write to the organisation's repos, so otherwise run them with `--dry-run` only. - A repo added to `settings/repos.json` also needs the "BSStudio settings check" GitHub App installed on it, which you can't do: tell the user. - `docs/workflows.md` and `scripts/workflow-style.mjs` stay in step: a change to the convention goes in together with the checker change that enforces it. -- A change to the shared checks reaches other repos only through a release: callers pin `shared-checks.yml` by the release commit's SHA with a `# vX.Y.Z` comment, and Renovate opens a PR in each caller for the new pin. The exception is the licence policy, `.github/dependency-review.yml`: every caller reads it from `main`, so a change applies to every repo as soon as it merges, and it keeps its path while any release still references it. The job names (`Workflows`, `Dependencies`) and the `dependency-review` input are an interface: every repo's ruleset requires `Checks / Workflows` by name, so renaming either blocks those PRs until every caller and ruleset is updated. +- A change to the shared checks reaches other repos only through a release: callers pin `shared-checks.yml` by the release commit's SHA with a `# vX.Y.Z` comment, and Renovate opens a PR in each caller for the new pin. The exception is the licence policy, `.github/dependency-review.yml`: every caller reads it from `main`, so a change applies to every repo as soon as it merges, and the file keeps its path, and `main` its name, while any release still references them. The job names (`Workflows`, `Dependencies`) and the `dependency-review` input are an interface: every repo's ruleset requires `Checks / Workflows` by name, so renaming either blocks those PRs until every caller and ruleset is updated. - Files in `assets/` keep their paths: other repos' READMEs embed them from `https://raw.githubusercontent.com/BSStudio/.github/main/assets/`. From 111a826223d570bec0bf6c19c9111cb0cfb2e1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Kecskem=C3=A9ty?= Date: Sun, 15 Nov 2026 03:49:56 +0100 Subject: [PATCH 4/4] Check each pull request's licence policy before callers read it --- .github/workflows/test.yml | 16 ++++++++++++++++ CLAUDE.md | 2 +- README.md | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4b2565..aabce1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,3 +34,19 @@ jobs: - name: Run tests run: node --test "scripts/*.test.mjs" + + licence-policy: + name: Licence policy + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Check out + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Review dependency changes against the policy + uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 + with: + config-file: ./.github/dependency-review.yml diff --git a/CLAUDE.md b/CLAUDE.md index bfd9728..a901126 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,7 +8,7 @@ Organisation-wide defaults for Budavári Schönherz Stúdió's GitHub repositori node --test "scripts/*.test.mjs" ``` -This repository's own `checks.yml` calls `shared-checks.yml` from the same commit, so the PR runs any change to the checks against this repository first, except the Dependencies job, which this repository doesn't enable. +This repository's own `checks.yml` calls `shared-checks.yml` from the same commit, so the PR runs any change to the checks against this repository first, except the Dependencies job, which this repository doesn't enable. Instead, the Test workflow's `Licence policy` job runs the dependency review with the PR's own `.github/dependency-review.yml`. ## Commits and branches diff --git a/README.md b/README.md index e458afa..bc0fa87 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,4 @@ Security features (secret scanning, push protection, Dependabot alerts, CodeQL d Every workflow follows one convention, written down in [`docs/workflows.md`](docs/workflows.md). Each repo enforces it with a `.github/workflows/checks.yml` that calls `.github/workflows/shared-checks.yml` here (the copyable caller is in the convention): `Checks / Workflows` runs actionlint, zizmor and `scripts/check-workflows.mjs` over the repo's workflows and composite actions, and `Checks / Dependencies` reviews new dependencies for vulnerabilities and licences in repos that turn it on. Wherever a ruleset exists it requires `Checks / Workflows`, plus `Checks / Dependencies` where the review is on. -Callers pin a tagged release of this repo; Renovate proposes each new release. The licence policy in `.github/dependency-review.yml` is the exception: `Checks / Dependencies` reads it from `main`, so allowing a licence or exempting a package needs no release. The checks run from the same commit as the workflow that calls them: `shared-checks.yml` reaches its composite action through the `$/` self-repository syntax. +Callers pin a tagged release of this repo; Renovate proposes each new release. The licence policy in `.github/dependency-review.yml` is the exception: `Checks / Dependencies` reads it from `main`, so allowing a licence or exempting a package needs no release. The `Licence policy` check runs each PR's version of the file here first. The checks run from the same commit as the workflow that calls them: `shared-checks.yml` reaches its composite action through the `$/` self-repository syntax.