From f6a9ac209ac38ceec3f2f8382780f3e676f6c23b Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 21 Jul 2026 21:30:32 +0200 Subject: [PATCH] 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))')