Skip to content

ci: build when no secret available - #224

Merged
MarcusDragsten merged 1 commit into
mainfrom
missing-acr-secret-workaround
Mar 4, 2026
Merged

ci: build when no secret available#224
MarcusDragsten merged 1 commit into
mainfrom
missing-acr-secret-workaround

Conversation

@MarcusDragsten

Copy link
Copy Markdown
Contributor

What does this pull request change?

Why is this pull request needed?

Issues related to this change

@MarcusDragsten
MarcusDragsten requested a review from a team as a code owner March 4, 2026 08:05
Copilot AI review requested due to automatic review settings March 4, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CI test workflow to successfully build the API Docker image even when the ACR secret isn’t available (e.g., forks / no secret passed via workflow_call), while still using registry cache when credentials exist.

Changes:

  • Adds a conditional in the “Build API image” step to skip ACR login/pull when ACR_SECRET is absent.
  • Provides ACR_SECRET via step-level env so the script can safely check for its presence.
Comments suppressed due to low confidence (1)

.github/workflows/tests.yaml:60

  • Using echo "$ACR_SECRET" | docker login ... --password-stdin can break if the secret starts with something echo treats as a flag (e.g. -n) or contains backslash escapes. Prefer printf '%s' "$ACR_SECRET" | docker login "$IMAGE_REGISTRY" ... --password-stdin (and quote the vars) to make the login robust.
            echo "$ACR_SECRET" | docker login $IMAGE_REGISTRY -u datamodelingtool --password-stdin
            docker pull $API_IMAGE
            DOCKER_BUILDKIT=1 docker build --target development --tag job-api-development --cache-from $API_IMAGE .

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MarcusDragsten
MarcusDragsten merged commit 23f0307 into main Mar 4, 2026
9 checks passed
@MarcusDragsten
MarcusDragsten deleted the missing-acr-secret-workaround branch March 4, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants