fix(ci): tighten the Collection archive check and make its guards testable
The forbidden names widen to anything containing "vault", SSH keys, .envrc and .env* files. Names that Windows or macOS extraction would read differently are rejected (trailing space or dot, reserved device names, "::", 8.3 aliases of .git, non-ASCII spaces, surrogate/private-use/unassigned characters, components over 255 bytes), and the .git test compares after NFKC and case folding. Duplicates are compared case-insensitively, a name that is both a file and a directory is rejected, and only one slash is stripped. A unit test builds a real tarball with ansible-galaxy, another asserts the directories build.yml prunes are in galaxy.yml build_ignore, lint.yml runs tests/scripts, and the Build workflow fails unless exactly one tarball matches. The docstring states that file symlinks are invisible to the archive check. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
b5751e14d6
commit
cab2187c89
5 files changed
+215
-20
No files matched your search
@@ -67,6 +67,11 @@ jobs:
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
- name: Test the repository scripts
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
python3 -m unittest discover -s tests/scripts
|
||||
|
||||
# The gitleaks hook scans --staged only, which is empty in a clean checkout,
|
||||
# so scan the PR's commits explicitly with the binary pre-commit built.
|
||||
- name: Scan PR commits for secrets
|
||||
|
||||
Reference in new issue
Block a user