feat(check-commits): report WIP commits as a separate check - #7
Draft
javier-godoy wants to merge 3 commits into
Draft
feat(check-commits): report WIP commits as a separate check#7javier-godoy wants to merge 3 commits into
javier-godoy wants to merge 3 commits into
Conversation
This was referenced Sep 9, 2026
javier-godoy
force-pushed
the
feature/wip-action-required
branch
8 times, most recently
from
September 10, 2026 03:48
802b3f7 to
f94d064
Compare
This was referenced Sep 10, 2026
javier-godoy
force-pushed
the
feature/wip-action-required
branch
3 times, most recently
from
September 10, 2026 14:53
ebda65e to
489c90d
Compare
The check run that GitHub creates for this job cannot carry a message: its conclusion is derived from the job outcome and its output is empty, so a pull request showed a failing check without saying why, and a WIP commit was reported exactly like an invalid commit message. The action is now asked not to report anything, and this workflow renders the outcome instead. The offending commits become annotations, the presence of WIP commits is reported as a check of its own, and the job fails if either check failed, so that the pull request is marked as failing while the checks themselves say which one it was. Nothing here is specific to pull requests: check runs attach to any commit, so the checks are also reported for the commits of other events. A pull request from a fork is the exception: it runs with a read-only token whatever the permissions block asks for, so no check run can be created for it. Rather than answering 403, the checks are skipped there. The annotations are workflow commands and still work, and the job still fails, so the outcome is reported either way; only the checks that carry it separately are missing, which is why they must not be required on a repository that takes contributions from forks.
The consistency between the version in the POM and the level of semantic versioning change described by the commit messages was enforced by failing this job, which made it indistinguishable from an invalid commit message. It is now reported as a check of its own, with the version and the level in its title, and it joins the other checks in failing the job. Both of its inputs are reported as unknown rather than assumed. The version is read with if: always(), because reading it does not depend on the commit check. The level is read from the SEMVER_LEVEL environment variable that the action exports, and it counts as unknown in two cases: when the action could not analyse the commit messages at all, which it signals by failing, and when no commit message could be parsed, because only a valid commit raises the level and NONE is also what an unparseable pull request leaves behind. The WIP check is reported as unknown on the first of those paths too, because an empty result is not evidence of consolidated commits.
The report input is not on action-conventional-commits master yet, so the workflow has to reference the feature branch for the new behaviour to be testable from a consumer repository. This commit must be dropped before merging.
javier-godoy
force-pushed
the
feature/wip-action-required
branch
from
September 10, 2026 17:27
489c90d to
446876c
Compare
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.
Refs FlowingCode/AddonsInternal#99
Depends on FlowingCode/action-conventional-commits#3
A Pull Request with
WIPcommits must not be merged, but that is an expected state of anunfinished branch rather than an error. Reporting it with the same failure as an invalid
commit message made the two indistinguishable.
WIP commits no longer fail the conventional commits step. They are reported as a separate
wip-commitscheck run with theaction_requiredconclusion, which keeps the merge blockedwithout marking the Pull Request as failing.
As a side effect, the version and Semantic Versioning checks now run for Pull Requests that
contain WIP commits, where previously the WIP failure skipped them.
Before merging
wip-commitsto the required status checks of the protected branches, otherwiseaction_requireddoes not block the merge.WIP:commit that pointsuses:atFlowingCode/action-conventional-commits@feature/wip-action-required, and restore@masteronce fix: set VERSION as maven project version instead first version found #3 is merged.Validated on javier-godoy/test-repo#11
WIP:commitcheck-commitssuccess,wip-commitsaction_required,mergeable_state=unstablewip-commitsrequired on the protected branchmergeable_state=blockedwip-commitssuccess,mergeable_state=cleanSo
action_requireddoes block the merge when the check is required, and it clears on its ownonce the branch is consolidated. The run also confirms that
contents: read+checks: writedeclared on the caller is enough on a repository whose default workflow permission is
read-only, and that the version and Semantic Versioning steps now run on Pull Requests that
contain WIP commits (previously the WIP failure skipped them).
The caveat above holds:
mergeable_stateisunstable, notclean, so GitHub still countsaction_requiredas a non-successful check and the Pull Request reads "Some checks were notsuccessful" rather than being green.
Notes for the reviewer
action_requiredmay not fully deliver the requested UX. GitHub's status-checkdocumentation puts
action_requiredin the failed bucket alongsidefailureandtimed_out. So this buys a distinct check name and an "Action required" label instead of"Failing", but the Pull Request rollup will most likely still read "Some checks were not
successful". The alternative that does render neutral is a commit status with state
pending(the mechanism the WIP app uses), which is a one-callswap:
checks.create→repos.createCommitStatus,action_required→pending. Worthtesting both on a scratch PR before we commit to either.
Fork Pull Requests get a read-only token, so
checks.createreturns 403 regardless of thepermissions:block, the job goes red, and a requiredwip-commitswould leave the PullRequest stuck on "Expected — waiting for status". The fix is a
pull_request_targetcompanion workflow that reads the commit messages through the API and never checks out the
head of the Pull Request. Until then, do not require
wip-commitson repositories that takecontributions from forks.
The
permissions:block is a tightening. This job currently inherits the repositorydefault, which is
writeon every scope; from now on it gets onlycontents: readandchecks: write. Both are sufficient for the steps in this workflow, and no caller needschanges while the callers keep the
writedefault. Note that any future step needing anotherscope (e.g. commenting on the Pull Request) must add it explicitly.
checks: writecan green a required check. A required status check is satisfied by themost recent check run of that name, so anything running in this job could fabricate one. That
is inherent to the approach, but it raises the value of pinning
FlowingCode/action-conventional-commits@masterto a tag or SHA — happy to do that here ifyou want it in the same Pull Request.
🤖 Generated with Claude Code