Repository navigation
Run breaking and changelog from one entrypoint - #215
Merged
Merged
Conversation
The two actions had separate entrypoints, 930 lines between them, whose helpers were identical except for four strings. They now share breaking/entrypoint.sh: the helpers exist once, and each action keeps its own flow, so nothing either one prints, outputs or exits with changes. changelog/action.yml points at ../breaking/Dockerfile, and each action.yml sets OASDIFF_ACTION_COMMAND to say which flow runs. Inputs are read from the INPUT_* environment variables GitHub passes to a Docker action, not from positional arguments. The two actions took 17 and 18 arguments in different orders, so a shared script reading positions would have been one misordered line from passing a token as a flag. It also takes both tokens off the docker command line. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The runner's sh is dash, which drops environment variables whose names contain a hyphen, so INPUT_GITHUB-TOKEN never reached the script. The action's container runs busybox ash, which keeps them, as bash does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #214.
breakingandchangeloghad separate entrypoints, 930 lines between them, with five helper functions that were identical apart from four strings. #214 had to make every change twice. They now share one script,breaking/entrypoint.sh(776 lines): the helpers exist once and each action keeps its own flow.No behavior change. Both
uses:paths, every input, every output and every default are as they were.What changed underneath:
changelog/action.ymlsetsimage: '../breaking/Dockerfile'. The path resolves relative to the metadata file and the build context is the Dockerfile's directory.OASDIFF_ACTION_COMMAND, set by eachaction.ymlunderruns.env, says which flow runs. It is not an input, so a workflow cannot set it.INPUT_*, the environment variables GitHub passes to a Docker action, andargsis gone from bothaction.ymlfiles. The two actions took 17 and 18 positional arguments in different orders (position 3 wasfail-onin one andinclude-path-paramsin the other), which a shared script could not read safely. Hyphens survive in the variable name, sooasdiff-tokenisINPUT_OASDIFF-TOKENand is read withprintenv. This also takes both tokens off thedocker runcommand line.How it was checked
A differential run of the old entrypoints against the new one, same inputs, comparing stdout, stderr, exit code,
$GITHUB_OUTPUT, the step summary, the output file and every request the script sent (comment, commit status, delivery report):45 spec pairs (43 sampled from the oasdiff fixtures, one with no changes, one that fails to load) across 21 input combinations:
fail-on,review: false, no token, a rejected comment with and without a fork,flatten-allof,exclude-elements,output-to-file, formats,level, prefixes, and the Pro path with and without a GitHub token.oasdiff --openandcurlwere stubbed so nothing left the machine; every other oasdiff call was the real v1.38.0 binary.Two differences the first run reported were in the harness, not the scripts: oasdiff writes
error_count,warning_countandinfo_countto$GITHUB_OUTPUTin map order, which varies between two runs of the same script, and one log line prints a temp path.The stub-based jobs that called the entrypoints with positional arguments now set
INPUT_*instead.One thing outside this repo: the release automation listed each action's Dockerfile by name, including
changelog/Dockerfile. It has been changed to read the list from the repository.🤖 Generated with Claude Code