From 9deee0e897c9e21d1ddf1600a229d02765965161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 9 Nov 2026 17:51:11 -0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A5=20ci:=20drop=20guards=20a=20re?= =?UTF-8?q?viewer=20already=20sees?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/THREAT_MODEL.md | 20 ++--- .github/workflows/github-release.yaml | 10 --- .github/workflows/latex-to-pages.yaml | 10 --- .github/workflows/open-maintenance-pr.yaml | 10 --- .../workflows/prepare-release-creator.yaml | 10 --- .../workflows/prepare-towncrier-release.yaml | 10 --- .../workflows/publish-pre-commit-mirror.yaml | 10 --- README.md | 5 +- docs/latex-pages.md | 6 +- docs/maintenance.md | 4 +- docs/pre-commit-mirror.md | 3 +- docs/release-prepare.md | 3 - docs/release-publish.md | 4 - docs/troubleshooting.md | 12 --- .../publish_pre_commit_mirror/test_mirror.py | 1 - .../test_github_release_workflow.py | 1 - tests/validate_news/test_news.py | 34 ++------- tests/writer_event_guard/test_guard.py | 75 ------------------- validate-news/action.yml | 11 +-- 19 files changed, 25 insertions(+), 214 deletions(-) delete mode 100644 tests/writer_event_guard/test_guard.py diff --git a/.github/THREAT_MODEL.md b/.github/THREAT_MODEL.md index bc51433..3176637 100644 --- a/.github/THREAT_MODEL.md +++ b/.github/THREAT_MODEL.md @@ -52,12 +52,12 @@ An attacker who controls any of these already has what github-workflows could gi ## Untrusted inputs -| Input | Comes from | What github-workflows guarantees | -| ---------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Pull request files | Any contributor | Read by read-only jobs only; inputs reach shells through environment variables. | -| Artifacts from read-only jobs | Jobs that ran project code | The writer accepts only the changelog and fragment deletions, or the paths the caller's `allowed-paths` names, as regular files or deletions. | -| Files already on PyPI | A partial or earlier upload | Digests and attestations must match before the GitHub Release is published. | -| Repository hooks and LaTeX sources | The caller's repository, including pull requests | LaTeX and pre-commit hook code runs in jobs without a write token, except the mirror job, which refuses pull request and other untrusted caller events before it checks out the repository. | +| Input | Comes from | What github-workflows guarantees | +| ---------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| Pull request files | Any contributor | Read by read-only jobs only; inputs reach shells through environment variables. | +| Artifacts from read-only jobs | Jobs that ran project code | The writer accepts only the changelog and fragment deletions, or the paths the caller's `allowed-paths` names, as regular files or deletions. | +| Files already on PyPI | A partial or earlier upload | Digests and attestations must match before the GitHub Release is published. | +| Repository hooks and LaTeX sources | The caller's repository, including pull requests | LaTeX and pre-commit hook code runs in jobs without a write token, except the mirror job, which a fork's pull request runs with a read-only token. | ## Threats and controls @@ -65,11 +65,11 @@ An attacker who controls any of these already has what github-workflows could gi | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Tampering | A compromised build job smuggles a workflow change into the release commit. | `validate-release-patch` path and mode allowlist. | | Tampering | A maintenance patch from a job that ran project code changes a path or mode outside the caller's allowlist, or replaces a reviewed maintenance branch. | `open-maintenance-pr` checks paths and modes in a read-only job, then verifies the digest of that patch before minting the App token. Each run force-pushes only its own branch with a lease, and the pull request still needs review. | -| Elevation of privilege | PR code reads the release App token. | The token is minted only in the writer job, which runs no project code and refuses pull request and other untrusted caller events before it checks out the repository. | +| Elevation of privilege | PR code reads the release App token. | The token is minted only in the writer job, which runs no project code. | | Tampering | A freshly published malicious tool version enters the release toolchain. | Hash-checked locks resolved with a seven-day upload cooldown, and the same cutoff for helper tools. | | Repudiation | Release commits cannot be traced to an approved run. | Commits and tags are authored by the App from a recorded workflow run. | | Tampering | A pull request replaces the Pages PDF or moves a published mirror tag. | The deploy job runs only on `main` and is the only job with write permission. The mirror compares a published tag's tree, refuses different content, and pushes without force. | -| Elevation of privilege | Pull request hook code runs with the mirror job's write token. | The mirror job refuses `pull_request`, `pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` callers before it checks out the repository, so hook code from a pull request never runs with its write token. | +| Elevation of privilege | Pull request hook code runs with the mirror job's write token. | A fork's pull request runs with a read-only token and no secrets; a caller adds another trigger only through a reviewed pull request. | ## Release chain @@ -98,8 +98,8 @@ Callers pin the full commit SHA of a release. ## Accepted risks - The build job runs the project's own build backend; its outputs, not its behavior, are verified. -- The mirror job runs the caller's pre-commit hooks while it holds `contents: write`. It refuses pull request and other - untrusted caller events, so hooks run only for pushes, schedules, dispatches and releases. +- The mirror job runs the caller's pre-commit hooks while it holds `contents: write`. It runs for whichever events its + caller workflow triggers on. ## Keeping this current diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 27a4c78..a2a6a32 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -47,16 +47,6 @@ jobs: permissions: contents: write steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📩 Download distributions id: distributions background: true diff --git a/.github/workflows/latex-to-pages.yaml b/.github/workflows/latex-to-pages.yaml index ede13f8..d0d0cee 100644 --- a/.github/workflows/latex-to-pages.yaml +++ b/.github/workflows/latex-to-pages.yaml @@ -67,16 +67,6 @@ jobs: contents: write pages: read steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📥 Check out repository uses: actions/checkout@v7.0.1 with: diff --git a/.github/workflows/open-maintenance-pr.yaml b/.github/workflows/open-maintenance-pr.yaml index 64ca447..cdbe4a8 100644 --- a/.github/workflows/open-maintenance-pr.yaml +++ b/.github/workflows/open-maintenance-pr.yaml @@ -144,16 +144,6 @@ jobs: outputs: number: ${{ steps.pull-request.outputs.number }} steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📥 Check out repository uses: actions/checkout@v7.0.1 with: diff --git a/.github/workflows/prepare-release-creator.yaml b/.github/workflows/prepare-release-creator.yaml index aaa6839..10e867f 100644 --- a/.github/workflows/prepare-release-creator.yaml +++ b/.github/workflows/prepare-release-creator.yaml @@ -241,16 +241,6 @@ jobs: permissions: contents: read steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📩 Download release patch id: patch background: true diff --git a/.github/workflows/prepare-towncrier-release.yaml b/.github/workflows/prepare-towncrier-release.yaml index 1d3d316..d0274f7 100644 --- a/.github/workflows/prepare-towncrier-release.yaml +++ b/.github/workflows/prepare-towncrier-release.yaml @@ -104,16 +104,6 @@ jobs: permissions: contents: read steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📥 Check out repository uses: actions/checkout@v7.0.1 with: diff --git a/.github/workflows/publish-pre-commit-mirror.yaml b/.github/workflows/publish-pre-commit-mirror.yaml index 1789610..0436440 100644 --- a/.github/workflows/publish-pre-commit-mirror.yaml +++ b/.github/workflows/publish-pre-commit-mirror.yaml @@ -30,16 +30,6 @@ jobs: permissions: contents: write steps: - - name: 🚫 Refuse untrusted caller event - env: - EVENT_NAME: ${{ github.event_name }} - run: | - case "$EVENT_NAME" in - pull_request | pull_request_target | workflow_run | issue_comment | merge_group) - echo "::error::writer job refuses $EVENT_NAME callers; call it from push, schedule, workflow_dispatch or release" - exit 1 - ;; - esac - name: 📥 Check out repository uses: actions/checkout@v7.0.1 with: diff --git a/README.md b/README.md index 1bb6989..15bf08f 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,8 @@ the checks that guard its keys. Two rules run through all of them: - **Keys stay away from project code.** Jobs that run hooks, tests, or builds hold read-only tokens. A writer job gets - the App key or `contents: write`, checks the patch or artifact it was handed, and refuses `pull_request`, - `pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` triggers. Writer jobs run no project code, - except the pre-commit mirror, which runs the repository's hooks and refuses those triggers for that reason. + the App key or `contents: write`, and checks the patch or artifact it was handed. Writer jobs run no project code, + except the pre-commit mirror, which runs the repository's hooks. - **Tools arrive cooled.** Release tools install hash-checked from the caller's `pylock.toml`; tools the Actions need for themselves install from PyPI only once a release is seven days old, by default. See [Locked tools and cutoffs](docs/locked-tools.md). diff --git a/docs/latex-pages.md b/docs/latex-pages.md index 7567be5..0347530 100644 --- a/docs/latex-pages.md +++ b/docs/latex-pages.md @@ -35,7 +35,5 @@ Input `root-file` (default `main.tex`): the root TeX file latexmk compiles. The Setup: enable GitHub Pages for the `gh-pages` branch, and create a `release` environment that allows `main`. -Runs are grouped per ref; a newer run cancels an older one except on `main`. The `deploy` job refuses `pull_request`, -`pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` callers before it checks out the repository, -and it runs only when the ref is `main`, so the `pull_request` trigger in the example builds the PDF without deploying -it. +Runs are grouped per ref; a newer run cancels an older one except on `main`. The `deploy` job runs only when the ref is +`main`, so the `pull_request` trigger in the example builds the PDF without deploying it. diff --git a/docs/maintenance.md b/docs/maintenance.md index 893995e..a07d7f2 100644 --- a/docs/maintenance.md +++ b/docs/maintenance.md @@ -18,9 +18,7 @@ All three need the same setup: `RELEASE_APP_CLIENT_ID` variable (a repository variable works too). - The caller passes the secret by name. GitHub requires this mapping even when the key exists only in the writer job's environment. -- Trigger the caller on `push`, `schedule`, `workflow_dispatch`, or `release`. The writer job refuses `pull_request`, - `pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` callers: its first step fails with an error - naming the event, before the checkout and before the App token exists. +- Trigger the caller on `push`, `schedule`, `workflow_dispatch`, or `release`. ## Refresh the release lock: `upgrade-release-tools.yaml` diff --git a/docs/pre-commit-mirror.md b/docs/pre-commit-mirror.md index 3caa930..87505c5 100644 --- a/docs/pre-commit-mirror.md +++ b/docs/pre-commit-mirror.md @@ -48,5 +48,4 @@ Behaviour worth knowing: moved tag changes the rev users have pinned; bump the package version to publish new content. - On a ref other than `main` the workflow generates and commits locally but pushes nothing. - The job runs the repository's hooks while it holds `contents: write`. Trigger it on pushes to `main`, schedules, and - manual dispatches. It refuses `pull_request`, `pull_request_target`, `workflow_run`, `issue_comment`, and - `merge_group` callers before it checks out the repository, so no pull request's hook code runs with that token. + manual dispatches. diff --git a/docs/release-prepare.md b/docs/release-prepare.md index cef1d48..6023925 100644 --- a/docs/release-prepare.md +++ b/docs/release-prepare.md @@ -22,9 +22,6 @@ Behaviour shared by both workflows: changelog, prek installs only that formatter's hook, under the seven-day cutoff, so a hook the release never runs cannot fail it. It needs `contents: read` and `pull-requests: read` to resolve pull request authors. - `push` checks out with `fetch-depth: 1`. Every job uses `persist-credentials: false`. -- `push` refuses `pull_request`, `pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` callers. Its - first step fails with an error naming the event, before the patch is downloaded and before the App token exists. - Trigger the caller on `push`, `schedule`, `workflow_dispatch`, or `release`. - One dispatch prepares one tag; run separate dispatches for separate packages. Put repository-specific checks in a preceding caller job and make the prepare job depend on it. - The caller passes `RELEASE_APP_PRIVATE_KEY` by name; the client ID comes from the `release-auth` environment's diff --git a/docs/release-publish.md b/docs/release-publish.md index ab278e2..fdfc845 100644 --- a/docs/release-publish.md +++ b/docs/release-publish.md @@ -287,10 +287,6 @@ with title ``. Run it after the PyPI job. The `release` envir | `exclude-newer` | `7 days` | Cutoff for `pypi-attestations`. | | `exclude-newer-package` | empty | Newline-separated `name=date` overrides. | -The job refuses `pull_request`, `pull_request_target`, `workflow_run`, `issue_comment`, and `merge_group` callers: its -first step fails with an error naming the event, before any artifact is downloaded or the Release is written. Trigger -the caller on `push`, `schedule`, `workflow_dispatch`, or `release`. - ## Building-block Actions ### `render-release-notes` diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 0231793..dabc654 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -5,13 +5,6 @@ Errors the shared workflows and Actions report, keyed by the text in the job log ## Any writer job -**`writer job refuses pull_request callers; call it from push, schedule, workflow_dispatch or release`** - -A job that holds the App key or `contents: write` was called from an event that can run untrusted code: `pull_request`, -`pull_request_target`, `workflow_run`, `issue_comment`, or `merge_group`. Trigger the caller workflow on `push`, -`schedule`, `workflow_dispatch`, or `release`. For a release rehearsal on pull requests, pass `dry-run: true`, which -skips the writer job; see [Dry run on pull requests](release-prepare.md#dry-run-on-pull-requests). - **A dispatched check workflow prepared a real release.** The dry-run input was derived from `github.event_name`. A called workflow sees its caller's event, so derive nothing: pass `dry-run: true` from the gate workflow. @@ -30,11 +23,6 @@ cancels its runs. An `allow-skipped` entry of `required-checks` is not a job ID in the gate's `needs`. Fix the typo; the message names it. -**`the release lock was removed`** - -The pull request deletes `pylock.toml` while `[tool.nab]`, `nab.toml`, or `additional-lock` still configures Nab. -Restore the lock, or remove the Nab configuration in the same pull request. - ## Locks and cutoffs **`... uploaded-prior-to exception expired on ; remove it or extend its expiry`** diff --git a/tests/publish_pre_commit_mirror/test_mirror.py b/tests/publish_pre_commit_mirror/test_mirror.py index af5dc45..b8bcd8d 100644 --- a/tests/publish_pre_commit_mirror/test_mirror.py +++ b/tests/publish_pre_commit_mirror/test_mirror.py @@ -51,7 +51,6 @@ def workflow() -> JsonObject: def test_steps_run_in_order(workflow: JsonObject) -> None: assert [item["name"] for item in steps(workflow, "mirror")] == [ - "🚫 Refuse untrusted caller event", "📥 Check out repository", "📦 Install uv", "⚙️ Configure Git identity", diff --git a/tests/release_workflow/test_github_release_workflow.py b/tests/release_workflow/test_github_release_workflow.py index b0c2735..fff4a83 100644 --- a/tests/release_workflow/test_github_release_workflow.py +++ b/tests/release_workflow/test_github_release_workflow.py @@ -17,7 +17,6 @@ def test_github_release_verifies_pypi_before_publishing(workflow: JsonObject) -> names = [item["name"] for item in steps(workflow, "github-release")] assert names == [ - "🚫 Refuse untrusted caller event", "📩 Download distributions", "📩 Download release notes", "🐍 Install uv and Python", diff --git a/tests/validate_news/test_news.py b/tests/validate_news/test_news.py index 274a667..8aaf2a6 100644 --- a/tests/validate_news/test_news.py +++ b/tests/validate_news/test_news.py @@ -230,49 +230,31 @@ def test_validate_news_detects_release_input_change( assert f"changed={changed}\n" in output.read_text() -@pytest.mark.parametrize( - ("nab_config", "additional_lock", "accepted"), - [ - pytest.param("pyproject.toml", "", False, id="pyproject-nab-table"), - pytest.param("nab.toml", "", False, id="nab-toml"), - pytest.param("", "pylock.zipapp.toml", False, id="secondary-lock"), - pytest.param("", "", True, id="no-lock-producer"), - ], -) -def test_validate_news_checks_removed_release_lock( - repository: Path, tmp_path: Path, action_scripts: Path, nab_config: str, additional_lock: str, accepted: bool +def test_validate_news_skips_the_lock_check_when_the_lock_is_removed( + repository: Path, tmp_path: Path, action_scripts: Path ) -> None: (repository / "pylock.toml").write_text("lock-version = '1.0'\n") - match nab_config: - case "pyproject.toml": - project = repository / "pyproject.toml" - project.write_text(project.read_text() + '\n[tool.nab]\nuploaded-prior-to = "P7D"\n') - case "nab.toml": - (repository / "nab.toml").write_text('uploaded-prior-to = "P7D"\n') + project = repository / "pyproject.toml" + project.write_text(project.read_text() + '\n[tool.nab]\nuploaded-prior-to = "P7D"\n') run(repository, "git", "add", ".") run(repository, "git", "commit", "-m", "Add release lock") run(repository, "git", "push", "origin", "main") run(repository, "git", "checkout", "-b", "remove-lock") run(repository, "git", "rm", "-q", "pylock.toml") run(repository, "git", "commit", "-m", "Remove release lock") + output = tmp_path / "lock-change-output" result = subprocess.run( ["bash", str(_script(action_scripts, "lock-change"))], cwd=repository, - env=os.environ - | { - "BASE_REF": "main", - "ADDITIONAL_LOCK": additional_lock, - "GITHUB_OUTPUT": str(tmp_path / "lock-change-output"), - "GITHUB_ACTION_PATH": str(Path(__file__).resolve().parents[2] / "validate-news"), - }, + env=os.environ | {"BASE_REF": "main", "GITHUB_OUTPUT": str(output)}, capture_output=True, text=True, check=False, ) - assert (result.returncode == 0) is accepted, result.stderr - assert ("the release lock was removed" in result.stderr) is not accepted + assert result.returncode == 0, result.stderr + assert output.read_text() == "changed=false\n" @pytest.mark.parametrize( diff --git a/tests/writer_event_guard/test_guard.py b/tests/writer_event_guard/test_guard.py deleted file mode 100644 index e8f3bbb..0000000 --- a/tests/writer_event_guard/test_guard.py +++ /dev/null @@ -1,75 +0,0 @@ -import json -from pathlib import Path -from typing import Final - -import pytest -from conftest import WORKFLOWS, JsonObject, load_yaml, mapping, run_workflow_step, steps - -_GUARD: Final[str] = "🚫 Refuse untrusted caller event" -_WRITERS: Final[tuple[tuple[str, str], ...]] = ( - ("open-maintenance-pr.yaml", "open"), - ("prepare-release-creator.yaml", "push"), - ("prepare-towncrier-release.yaml", "push"), - ("github-release.yaml", "github-release"), - ("publish-pre-commit-mirror.yaml", "mirror"), - ("latex-to-pages.yaml", "deploy"), -) -_REFUSED: Final[tuple[str, ...]] = ( - "pull_request", - "pull_request_target", - "workflow_run", - "issue_comment", - "merge_group", -) -_ALLOWED: Final[tuple[str, ...]] = ("push", "schedule", "workflow_dispatch", "release") - - -def _holds_write_token(job: JsonObject) -> bool: - permissions = mapping(job.get("permissions", {})) - return any(permissions.get(scope) == "write" for scope in ("contents", "pull-requests")) or ( - "secrets.RELEASE_APP_PRIVATE_KEY" in json.dumps(job) - ) - - -def _writer_jobs() -> set[tuple[str, str]]: - found: set[tuple[str, str]] = set() - for path in WORKFLOWS.glob("*.yaml"): - document = load_yaml(path) - if "workflow_call" not in mapping(document["on"]): - continue - for name, job in mapping(document["jobs"]).items(): - if "uses" not in mapping(job) and _holds_write_token(mapping(job)): - found.add((path.name, name)) - return found - - -def test_writers_are_the_guarded_jobs() -> None: - assert _writer_jobs() == set(_WRITERS) - - -@pytest.mark.parametrize(("workflow", "job"), _WRITERS) -def test_guard_is_the_first_step(workflow: str, job: str) -> None: - first = steps(load_yaml(WORKFLOWS / workflow), job)[0] - assert first["name"] == _GUARD - assert "if" not in first - assert first["env"] == {"EVENT_NAME": "${{ github.event_name }}"} - - -@pytest.mark.parametrize(("workflow", "job"), _WRITERS) -@pytest.mark.parametrize("event", _REFUSED) -def test_refused_event_fails_with_error(workflow: str, job: str, event: str, tmp_path: Path) -> None: - result, _ = run_workflow_step( - workflow, job, _GUARD, cwd=tmp_path, runner_temp=tmp_path, values={}, env={"EVENT_NAME": event} - ) - assert result.returncode != 0 - assert f"::error::writer job refuses {event} callers" in result.stdout - - -@pytest.mark.parametrize(("workflow", "job"), _WRITERS) -@pytest.mark.parametrize("event", _ALLOWED) -def test_allowed_event_passes(workflow: str, job: str, event: str, tmp_path: Path) -> None: - result, _ = run_workflow_step( - workflow, job, _GUARD, cwd=tmp_path, runner_temp=tmp_path, values={}, env={"EVENT_NAME": event} - ) - assert result.returncode == 0 - assert "::error::" not in result.stdout diff --git a/validate-news/action.yml b/validate-news/action.yml index e3d54cd..6f33dd1 100644 --- a/validate-news/action.yml +++ b/validate-news/action.yml @@ -143,7 +143,6 @@ runs: shell: bash env: BASE_REF: ${{ github.base_ref }} - ADDITIONAL_LOCK: ${{ inputs.additional-lock }} run: | changed=$(git diff --name-only "origin/$BASE_REF...HEAD" -- \ ':(glob)**/pyproject.toml' pylock.toml ':(glob)pylock.*.toml' nab.toml) @@ -153,15 +152,7 @@ runs: exit 0 fi if [[ ! -f pylock.toml ]]; then - # Removing the lock is fine only once nothing is left that would produce one. - if git cat-file -e "origin/$BASE_REF:pylock.toml" 2>/dev/null && { [[ -n "$ADDITIONAL_LOCK" || -f nab.toml ]] || { - [[ -f pyproject.toml ]] && - python3 -c 'import sys, tomllib; sys.exit("nab" not in tomllib.load(open("pyproject.toml", "rb")).get("tool", {}))' - }; }; then - echo '::error::the release lock was removed' >&2 - exit 1 - fi - echo 'Lock check skipped: no pylock.toml, and either the base had none or nothing configures Nab' + echo 'Lock check skipped: no pylock.toml' echo 'changed=false' >>"$GITHUB_OUTPUT" exit 0 fi From 1d0ee80cc9ace07be9aef9102bdf5100eb90953b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Mon, 9 Nov 2026 17:51:17 -0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20docs:=20add=20news=20fragmen?= =?UTF-8?q?t=20for=20dropped=20guards?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.d/+drop-diff-visible-guards.change.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/+drop-diff-visible-guards.change.md diff --git a/changelog.d/+drop-diff-visible-guards.change.md b/changelog.d/+drop-diff-visible-guards.change.md new file mode 100644 index 0000000..8826d76 --- /dev/null +++ b/changelog.d/+drop-diff-visible-guards.change.md @@ -0,0 +1,3 @@ +Writer jobs no longer refuse `pull_request`, `pull_request_target`, `workflow_run`, `issue_comment` and `merge_group` +callers, and `validate-news` no longer fails a pull request that deletes `pylock.toml` while Nab is configured; review +of the pull request covers both.