ci: check image pins and image version bumps in Lint
Add scripts/check_image_versions.py (pins mode, and bump mode on pull requests) with unit tests, and run both plus the scripts' tests in lint.yml. tests/scripts is added to galaxy.yml build_ignore. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
32018e27f0
commit
a51090192e
5 files changed
+349
No files matched your search
@@ -67,6 +67,26 @@ jobs:
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
# Image versions and pins (scripts/check_image_versions.py): a change to an image's
|
||||
# inputs needs a higher version in image.yml, and a pin in a workflow must name an
|
||||
# image of the matrix. Not a pre-commit hook: a change to .pre-commit-config.yaml
|
||||
# is itself an input of the ci image and would force an image rebuild.
|
||||
- name: Check image pins
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
python3 scripts/check_image_versions.py pins
|
||||
|
||||
- name: Check image versions were bumped
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
export PATH="/opt/venv/bin:$PATH"
|
||||
python3 scripts/check_image_versions.py bump origin/main
|
||||
|
||||
- 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