From 7f6c8d1304bdd37ff7a29f9a281a3099eff4d90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20M=C3=A9ndez?= Date: Sun, 27 Sep 2026 06:44:54 +0000 Subject: [PATCH] Run the changelog check only where it can read the pull request `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. --- .github/workflows/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2b36724..b03611d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,6 +52,16 @@ jobs: parent: core timeout: 60 package: + # Only on a pull request. require-changelog compares the two commits of + # the pull request, which it reads from + # github.event.pull_request.base.sha; outside a pull request that is + # empty and the script is handed one argument instead of two, so every + # push to main failed the check. The keel repository already gates it + # this way. A job whose condition is false is reported as skipped, + # which satisfies a required status, so protection keeps working and + # the check is still a real run on the pull request itself, which is + # the only place it can say anything. + if: github.event_name == 'pull_request' # This recipe has no debian/changelog: what bt-layer records in the # manifest is the top entry of ./changelog, which is also what # make-release-deb.py turns into the release package. So that is the