Skip to content

Run the changelog check only where it can read the pull request - #3

Merged
marcos-mendez merged 1 commit into
mainfrom
ci/changelog-only-on-pull-request
Sep 27, 2026
Merged

marcos-mendez merged 1 commit into
mainfrom
ci/changelog-only-on-pull-request

Conversation

@marcos-mendez

Copy link
Copy Markdown
Contributor

package / changelog failed on every push to main, including the commit
that created the repository, which had nothing to check.

require-changelog takes the two commits of the pull request and the
workflow reads them from github.event.pull_request.base.sha. On a push
that context is empty, so the script is handed one argument where it
expects two and exits 3 on its own usage. The check was reporting a
defect in the workflow that called it, on every merge, next to the two
checks that were telling the truth.

The keel repository already gates the job with
if: github.event_name == 'pull_request'; this is the same line. A job
whose condition is false is reported to the branch protection rule as
skipped, which satisfies a required status, so requiring
package / changelog on main keeps working and the check is still a real
run on the pull request, which is the only place it has anything to
compare.

`package / changelog` failed on every push to main, including the commit
that created the repository, which had nothing to check.

require-changelog takes the two commits of the pull request and the
workflow reads them from `github.event.pull_request.base.sha`. On a push
that context is empty, so the script is handed one argument where it
expects two and exits 3 on its own usage. The check was reporting a
defect in the workflow that called it, on every merge, next to the two
checks that were telling the truth.

The keel repository already gates the job with
`if: github.event_name == 'pull_request'`; this is the same line. A job
whose condition is false is reported to the branch protection rule as
skipped, which satisfies a required status, so requiring
`package / changelog` on main keeps working and the check is still a real
run on the pull request, which is the only place it has anything to
compare.
@marcos-mendez
marcos-mendez merged commit a7aaf3b into main Sep 27, 2026
2 of 3 checks passed
@marcos-mendez
marcos-mendez deleted the ci/changelog-only-on-pull-request branch September 27, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant