Compare commits

...

6 Commits

Author SHA1 Message Date
github-actions
0cf9fb37a5 Github bot : issues linked to readme 2026-07-21 20:06:21 +00:00
Alexandre
447fd42f39 Merge pull request #2887 from alexbelgium/fix/pr-check-workflow-base-sha
Fix PR Check Build workflow: github.event.before is empty on pull_request events
2026-07-21 21:44:11 +02:00
alexbelgium
d9105b4128 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.
2026-07-21 21:41:33 +02:00
alexbelgium
01e5498573 Derive base SHA from the merge commit's own parent, not the event snapshot
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.
2026-07-21 21:39:54 +02:00
alexbelgium
f6a9ac209a 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.
2026-07-21 21:30:32 +02:00
alexbelgium
5668c15418 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.
2026-07-21 20:38:01 +02:00
2 changed files with 22 additions and 6 deletions

View File

@@ -19,11 +19,20 @@ 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: |
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)
# 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"
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 +41,17 @@ 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)
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"
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)
{
echo "changelogs_files<<EOF_CHANGELOG_FILES"
echo "$changed_changelog_files"
echo "EOF_CHANGELOG_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))')

View File

@@ -1,3 +1,4 @@
## &#9888; Open Request : [✨ [REQUEST] qbittorrent (opened 2025-10-11)](https://github.com/alexbelgium/hassio-addons/issues/2139) by [@nyok92](https://github.com/nyok92)
## &#9888; Open Request : [✨ [REQUEST] transmission, document where torrent files are stored (opened 2026-07-14)](https://github.com/alexbelgium/hassio-addons/issues/2852) by [@bilogic](https://github.com/bilogic)
# Hass.io Add-ons: Tor with bridges