From 5668c1541880641ab2dde5d7b205bdba01c5c5eb Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 21 Jul 2026 20:38:01 +0200 Subject: [PATCH 1/4] Fix PR Check Build workflow using empty github.event.before github.event.before is only populated on push events, but this workflow triggers on pull_request, where it's empty. This made every git diff call fail (fatal: ambiguous argument) and changed-addons resolve to [], so addon linting, build testing, and changelog checks were silently skipped on every PR regardless of what changed. Use github.event.pull_request.base.sha instead, which is always populated for pull_request-triggered runs. --- .github/workflows/onpr_check-pr.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/onpr_check-pr.yaml b/.github/workflows/onpr_check-pr.yaml index ecc6ee12fc..715cc1c1fa 100644 --- a/.github/workflows/onpr_check-pr.yaml +++ b/.github/workflows/onpr_check-pr.yaml @@ -22,8 +22,8 @@ jobs: - name: Find changed addon directories id: find_addons run: | - git fetch origin "${{ github.event.before }}" || true - changed_config_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) + git fetch origin "${{ github.event.pull_request.base.sha }}" || true + changed_config_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) echo "Changed config files:" echo "$changed_config_files" changed_addons=$(printf '%s' "$changed_config_files" | awk -F/ '{print $1}' | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))') @@ -32,11 +32,11 @@ jobs: - name: Find changelog id: changed-files run: | - git fetch origin "${{ github.event.before }}" || true - changed_changelog_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -iE '^([^/]+/)?changelog\.(md|txt|ya?ml|json)$' || true) + git fetch origin "${{ github.event.pull_request.base.sha }}" || true + changed_changelog_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -iE '^([^/]+/)?changelog\.(md|txt|ya?ml|json)$' || true) echo "$changed_changelog_files" echo "changelogs_files=$changed_changelog_files" >> "$GITHUB_OUTPUT" - changed_config_files=$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) + changed_config_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) echo "$changed_config_files" all_changed_files=$(echo -e "$changed_config_files\n$changed_changelog_files" | sort -u) changed_addons=$(printf '%s' "$all_changed_files" | awk -F/ '{print $1}' | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))') From f6a9ac209ac38ceec3f2f8382780f3e676f6c23b Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 21 Jul 2026 21:30:32 +0200 Subject: [PATCH 2/4] Address review feedback: fail loudly on real fetch/diff errors, fix multiline output - Stop masking git fetch/diff failures with a blanket `|| true`. That swallowed real errors (bad ref, network failure) into an empty changed_addons result, the same silent-skip failure mode this PR exists to fix. Capture the diff separately from the grep filter so `|| true` only covers grep's expected "no match" exit code, while fetch/diff failures now abort the job via the runner's default `set -eo pipefail`. - Write changelogs_files using the GITHUB_OUTPUT multiline delimiter syntax instead of a plain `key=value` echo. A PR touching more than one addon's CHANGELOG.md produced a value with embedded newlines, which corrupts the output file under the single-line format. Addresses review comments from coderabbitai and chatgpt-codex-connector on PR #2887. --- .github/workflows/onpr_check-pr.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/onpr_check-pr.yaml b/.github/workflows/onpr_check-pr.yaml index 715cc1c1fa..86e409031a 100644 --- a/.github/workflows/onpr_check-pr.yaml +++ b/.github/workflows/onpr_check-pr.yaml @@ -22,8 +22,9 @@ jobs: - name: Find changed addon directories id: find_addons run: | - git fetch origin "${{ github.event.pull_request.base.sha }}" || true - changed_config_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) + git fetch origin "${{ github.event.pull_request.base.sha }}" + diff_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}") + changed_config_files=$(printf '%s\n' "$diff_files" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) echo "Changed config files:" echo "$changed_config_files" changed_addons=$(printf '%s' "$changed_config_files" | awk -F/ '{print $1}' | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))') @@ -32,11 +33,16 @@ jobs: - name: Find changelog id: changed-files run: | - git fetch origin "${{ github.event.pull_request.base.sha }}" || true - changed_changelog_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -iE '^([^/]+/)?changelog\.(md|txt|ya?ml|json)$' || true) + git fetch origin "${{ github.event.pull_request.base.sha }}" + diff_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}") + changed_changelog_files=$(printf '%s\n' "$diff_files" | grep -iE '^([^/]+/)?changelog\.(md|txt|ya?ml|json)$' || true) echo "$changed_changelog_files" - echo "changelogs_files=$changed_changelog_files" >> "$GITHUB_OUTPUT" - changed_config_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) + { + echo "changelogs_files<> "$GITHUB_OUTPUT" + changed_config_files=$(printf '%s\n' "$diff_files" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) echo "$changed_config_files" all_changed_files=$(echo -e "$changed_config_files\n$changed_changelog_files" | sort -u) changed_addons=$(printf '%s' "$all_changed_files" | awk -F/ '{print $1}' | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))') From 01e54985736be8f8b1f07374c2e875d304c0b7ac Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 21 Jul 2026 21:39:54 +0200 Subject: [PATCH 3/4] Derive base SHA from the merge commit's own parent, not the event snapshot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit github.event.pull_request.base.sha is fixed at the time the triggering event fired. In a repo with frequent direct-to-master pushes, master can advance between that event and job checkout, while the actions/checkout merge commit (github.sha) is always built against the *current* master tip. Diffing the stale event SHA against the live merge commit picked up unrelated upstream commits — observed live on this PR: scrutiny and scrutiny_fa showed up as "changed" and failed their changelog check, even though this PR only touches the workflow file. HEAD^1 is the actual base the checked-out merge commit was built from (verified: parents are [live master tip, PR head]), so it can't go stale. --- .github/workflows/onpr_check-pr.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/onpr_check-pr.yaml b/.github/workflows/onpr_check-pr.yaml index 86e409031a..bd4ab6a197 100644 --- a/.github/workflows/onpr_check-pr.yaml +++ b/.github/workflows/onpr_check-pr.yaml @@ -22,8 +22,12 @@ jobs: - name: Find changed addon directories id: find_addons run: | - git fetch origin "${{ github.event.pull_request.base.sha }}" - diff_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}") + # github.event.pull_request.base.sha is a snapshot from event-trigger time and can be + # stale if master advances before checkout; HEAD^1 is the actual base this merge + # commit was built against, so it's always correct. + base_sha=$(git rev-parse HEAD^1) + git fetch origin "$base_sha" + diff_files=$(git diff --name-only "$base_sha" "${{ github.sha }}") changed_config_files=$(printf '%s\n' "$diff_files" | grep -E '^[^/]+/config\.(json|ya?ml)$' || true) echo "Changed config files:" echo "$changed_config_files" @@ -33,8 +37,9 @@ jobs: - name: Find changelog id: changed-files run: | - git fetch origin "${{ github.event.pull_request.base.sha }}" - diff_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}") + base_sha=$(git rev-parse HEAD^1) + git fetch origin "$base_sha" + diff_files=$(git diff --name-only "$base_sha" "${{ github.sha }}") changed_changelog_files=$(printf '%s\n' "$diff_files" | grep -iE '^([^/]+/)?changelog\.(md|txt|ya?ml|json)$' || true) echo "$changed_changelog_files" { From d9105b412869ed2cef41b849af5d2f8abbeb4faf Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 21 Jul 2026 21:41:33 +0200 Subject: [PATCH 4/4] Fix HEAD^1 resolution: fetch-depth 2 on check-addon-changes checkout Confirmed on the live run: a depth-1 (default) shallow checkout of the merge commit truncates parent refs at that boundary commit entirely, so git rev-parse HEAD^1 fails with "unknown revision" even though the merge commit itself is checked out fine. Bumping this job's checkout to fetch-depth: 2 pulls in both the merge commit and its two parents, making HEAD^1 resolvable with a real tree to diff against. --- .github/workflows/onpr_check-pr.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/onpr_check-pr.yaml b/.github/workflows/onpr_check-pr.yaml index bd4ab6a197..5dc7d84144 100644 --- a/.github/workflows/onpr_check-pr.yaml +++ b/.github/workflows/onpr_check-pr.yaml @@ -19,6 +19,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v7 + with: + # Need the merge commit's parents resolvable (HEAD^1 below): a depth-1 shallow + # checkout truncates parent refs entirely at the boundary commit. + fetch-depth: 2 - name: Find changed addon directories id: find_addons run: |