Skip to content

Fail a breaking pull request until it gets the allow label - #83

Merged
Mpdreamz merged 1 commit into
mainfrom
allow-label
Nov 14, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
allow-label

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

pull-request --fail-on major fails the check on a breaking change, labels it breaking, and says in the comment that adding breaking-allowed lets it through. Once someone adds the label, the next run passes.

Prompt summary: The GitHub Action should set the breaking label, and it should also allow a configurable allow label. The flow: a library author makes a breaking change, assembly-differ detects it, applies breaking and fails. The author applies the allow label, the workflow runs again, and it succeeds.

Why

pull-request labelled a breaking change but could not hold it back. Failing on it took --fail-on on the comparison step, which knows nothing about labels, so an intended break failed every run until someone loosened the workflow.

What

The labels decide the gate

pull-request now reads the pull request's labels before it writes anything. With --fail-on major, a Major suggestion fails with exit code 4 unless the pull request has the allow label. The default is breaking-allowed, and --allow-label renames it. A change below --fail-on passes as before. The release label is set either way, so breaking stays on the pull request after the break is allowed.

The comment says what to do

A blocked change opens the comment with a caution: the check fails, and adding breaking-allowed allows it if the change is intended. An allowed change gets a note that the label allows it. The console says the same.

Runs without labels

Outside a pull request there are no labels, so --fail-on applies as it does on the other commands. A read-only token, as on a pull request from a fork, can still read the labels, so the gate works there too; only the comment and label writes are skipped, with a warning.

Verify

mise run test
# PullRequestTests: Fails_a_breaking_change_until_the_allow_label_is_added runs the whole flow against FakeGitHub

The workflow has to run on the labeled and unlabeled pull request events, so adding the label runs the check again; the README says so, and the GitHub Action pull request sets it up.

Stack: 2 of 2, on top of #82.

🤖 Generated with Claude Code

@Mpdreamz Mpdreamz added the feature A new capability (minor bump) label Nov 14, 2026
Base automatically changed from typed-fail-on to main November 14, 2026 08:52
A breaking change could be labelled but not held back with a way to say
it was intended. pull-request --fail-on major now fails the check on a
change that big, unless the pull request has the breaking-allowed label;
the comment says which label lets it through. Adding the label reruns the
workflow, which passes and keeps the breaking label for release-drafter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit e75a0ee into main Nov 14, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the allow-label branch November 14, 2026 08:57
Mpdreamz added a commit that referenced this pull request Nov 14, 2026
…#84)

`uses: nullean/assembly-differ@v1` now compares a pull request's
libraries with their last release, comments, sets the release-drafter
label, and fails on a breaking change until the pull request gets the
`breaking-allowed` label. The old inputs still work.

**Prompt summary:** The action's arguments are hard to use, and there is
no clear path to hooking it up to pull requests. It should set the
`breaking` label, fail, and pass once a configurable allow label is
added: the author makes a breaking change, the action detects it, labels
it and fails, the author adds the allow label, and the next run
succeeds.

## Why
The action ran `assembly-differ diff <first> <second> <args>` in a
container: two provider specs and a free-form string. It had no outputs
and did nothing on the pull request. Wiring it up took a hand-written
workflow around it.

## What

#### A composite action
It installs the tool with `dotnet tool`, so the solution mode can read
the projects with the SDK the build already set up. Without `package` it
runs `projects`, comparing every library of the solution in
`working-directory` with its latest release; with `package` it runs
`release` on that `.nupkg`. The report goes to `api-changes.json`, and
`pull-request` puts it on the pull request.

#### Typed inputs and outputs
The inputs are `package`, `projects`, `target`, `framework`, `fail-on`
(default `major`), `allow-label` (default `breaking-allowed`), the three
label names, `comment`, `labels`, `working-directory`, `token` and
`version`. The outputs are `suggested-change`, `breaking-changes` and
`report`. Every input reaches the scripts through environment variables,
never through `${{ }}` inside `run:`, so `zizmor` reports no findings.
The tool is called by path, not added to `GITHUB_PATH`.

#### The old inputs
`first`, `second` and `args` still run `diff` in
`ghcr.io/nullean/assembly-differ:edge`, with the workspace mounted as
before, and print a deprecation warning.

#### README
A workflow to copy, with the `labeled` and `unlabeled` events that make
adding the allow label rerun the check, a table of inputs, and what
happens on a pull request from a fork.

## Verify
```bash
zizmor --min-severity low action.yml
```

I ran the steps' scripts locally against argh's solution and a Proc
package, with a stand-in for the installed tool. The solution suggested
`None` and passed. The package suggested `Major` with 5 breaking
changes, set the outputs, and exited `4` under `fail-on: major`.

**Out of scope:** The action installs the latest released tool, and
`pull-request --fail-on --allow-label` arrives in
[#83](#83). So the new
path works from the first release that carries #83, which is planned as
1.0, the release that also creates the `v1` tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new capability (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant