fix: resolve BASE_REPO variable scope issue#17
Merged
Conversation
The BASE_REPO variable was only defined inside the repository allowlist validation block, but it was being used later in the image existence check. This caused the variable to be empty when verify_image_existence was enabled. Changes: - Move BASE_REPO extraction logic outside the conditional block (before step 4) - Now BASE_REPO is always available for both repository validation and image existence check - Update step numbering in comments (steps 4-7 instead of 3-5) - Add explicit logging of BASE_REPO value for debugging This fixes the validation failure in PR #362 where image existence check was failing due to empty BASE_REPO variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
BASE_REPOvariable was only defined inside the repository allowlist validation block (step 3), but it was being used later in the image existence check (step 5). This caused the variable to be empty whenverify_image_existencewas enabled, leading to validation failures.Root Cause
In the image validation loop:
BASE_REPOextraction logic was inside theif [ -n "$ALLOWED_REPOS" ]block (lines 433-440)CANONICAL_IMAGE="${BASE_REPO}:${TAG}"ALLOWED_REPOSwas set,BASE_REPOwas defined and everything workedSolution
BASE_REPOis always available for both repository validation and image existence checkBASE_REPOvalue for debuggingChanges
Testing
This fixes the validation failure in PR #362 where the image existence check was failing due to empty
BASE_REPOvariable.After this fix is merged and v1.1.1 tag is recreated, PR #362 should pass all validations.
Related