Skip to content

ci: vendor validation scripts and remove remote action pins - #47

Merged
hyperpolymath merged 1 commit into
mainfrom
fix-ci-actions
Jul 27, 2026
Merged

ci: vendor validation scripts and remove remote action pins#47
hyperpolymath merged 1 commit into
mainfrom
fix-ci-actions

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Automated PR to fix CI after deleted actions.

Comment thread .githooks/validate-k9.sh
Comment thread .githooks/validate-k9.sh
@gitar-bot

gitar-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Vendors validation scripts and unpins remote CI actions, but the read loops drop final lines lacking trailing newlines and empty array expansions fail under set -u on bash versions below 4.4.

✅ 2 resolved
Bug: Empty array expansion may fail under set -u on bash <4.4

📄 .githooks/validate-k9.sh:48-54 📄 .githooks/validate-a2ml.sh:47-53
path_ignored iterates for frag in "${PATHS_IGNORE[@]}" while set -u is active. When no paths-ignore fragments are configured (the common case) the array is empty, and on bash <4.4 (notably macOS's default bash 3.2, relevant since these live in .githooks and may run as local hooks) expanding an empty array under set -u aborts with 'unbound variable'. GitHub's ubuntu-latest ships bash 5 so CI is unaffected, but local hook runs can crash. Use "${PATHS_IGNORE[@]+"${PATHS_IGNORE[@]}"}" or a length guard.

Edge Case: read loops drop final line lacking trailing newline

📄 .githooks/validate-k9.sh:122-131 📄 .githooks/validate-k9.sh:141-150 📄 .githooks/validate-k9.sh:169-183 📄 .githooks/validate-a2ml.sh:102-111 📄 .githooks/validate-a2ml.sh:128-142 📄 .githooks/validate-a2ml.sh:239-253 📄 .githooks/validate-a2ml.sh:270-280
Every validation loop uses while IFS= read -r line; do ... done < "$file". read returns non-zero at EOF, so a final line with no trailing newline is never processed. A .k9/.a2ml file whose last (or only) line carries the K9! magic number, an SPDX header, or an identity/version field would be silently skipped, producing a false 'missing' error and failing CI on valid files. Guard the loops with a trailing-content check, e.g. while IFS= read -r line || [[ -n "$line" ]]; do.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@hyperpolymath
hyperpolymath merged commit 6260459 into main Jul 27, 2026
22 of 25 checks passed
@hyperpolymath
hyperpolymath deleted the fix-ci-actions branch July 27, 2026 22:41
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