Skip to content

Commit 4def28a

Browse files
authored
fix: cleanup temp files to resolve Bug #1 and Bug #2 (#18)
## Bug Fixes: Temp File Cleanup (Bug #1 and Bug #2) Fixes critical bugs by adding explicit cleanup of temp files at the start of each job. **Root Cause:** /tmp directory persists between jobs in GitHub Actions. **Bugs Fixed:** - Bug #1: Exit code 1 on successful validations (Test Cases #1, #2) - Bug #2: Wrong image processed (Test Case #6) **Solution:** Add `rm -f` cleanup at start of each step using temp files. --- Will recreate tag v1.1.1 after merge to avoid changing caller workflows.
1 parent 1c277e3 commit 4def28a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/deployment-guard.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ jobs:
208208
- name: Check files against allowlist
209209
id: check-files
210210
run: |
211+
# Clean temp files from any previous runs
212+
rm -f /tmp/disallowed_files.txt
213+
211214
CHANGED_FILES='${{ steps.get-files.outputs.files }}'
212215
ALLOWED_PATTERN='${{ inputs.allowed_files_pattern }}'
213216
@@ -273,6 +276,9 @@ jobs:
273276
- name: Check only image field changed
274277
id: check-changes
275278
run: |
279+
# Clean temp files from any previous runs
280+
rm -f /tmp/validation_failed.txt /tmp/new_images.txt /tmp/old_images.txt
281+
276282
CHANGED_FILES='${{ needs.validate-changed-files.outputs.changed-files }}'
277283
278284
if [ "$CHANGED_FILES" = "" ] || [ "$CHANGED_FILES" = "[]" ]; then
@@ -377,6 +383,9 @@ jobs:
377383
- name: Validate image format, repository, tag, and existence
378384
id: validate
379385
run: |
386+
# Clean temp files from any previous runs
387+
rm -f /tmp/validation_failed.txt
388+
380389
NEW_IMAGES='${{ needs.validate-image-only-changed.outputs.new-images }}'
381390
OLD_IMAGES='${{ needs.validate-image-only-changed.outputs.old-images }}'
382391
ALLOWED_REPOS='${{ inputs.allowed_image_repositories }}'

0 commit comments

Comments
 (0)