fix(build): harden the Collection archive check and refuse source symlinks
check_tarball.py now compares path components case-insensitively (.GIT, Molecule), rejects backslashes and control or zero-width characters, duplicate members, an empty archive and a missing REQUIRED file, and reports an unreadable archive as one line. Drop the shebang and the executable bit and pass check= to subprocess.run so ansible-test sanity passes. ansible-galaxy dereferences symlinks, which the archive check cannot see, so the Build workflow fails when the source tree holds a symlink. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
580df0b892
commit
b5751e14d6
4 files changed
+143
-23
No files matched your search
@@ -83,6 +83,18 @@ jobs:
|
||||
fi
|
||||
echo "Tag $TAG is annotated and matches galaxy.yml version $version"
|
||||
|
||||
# ansible-galaxy dereferences symlinks when it builds, so a symlink in the source tree
|
||||
# reaches the archive as a regular file with the target's content, where
|
||||
# scripts/check_tarball.py cannot see it. Refuse them in the tree instead.
|
||||
- name: Refuse symlinks in the source tree
|
||||
run: |
|
||||
links="$(find . -path ./.git -prune -o -path ./.venv -prune -o -type l -print)"
|
||||
if [ -n "$links" ]; then
|
||||
echo "::error::symlinks in the source tree would be dereferenced into the Collection archive:"
|
||||
echo "$links"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build the Collection
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
Reference in new issue
Block a user