Skip to content

ci: replace manual docker login with docker/login-action#477

Open
einarwar wants to merge 1 commit intomainfrom
ci/use-docker-login-action
Open

ci: replace manual docker login with docker/login-action#477
einarwar wants to merge 1 commit intomainfrom
ci/use-docker-login-action

Conversation

@einarwar
Copy link
Copy Markdown
Contributor

Summary

Replace all manual echo $TOKEN | docker login CLI commands with the official docker/login-action@v3 across CI workflows.

Changes

All workflows (publish-image, tests, rollback)

  • Replace echo ${{ secrets.GITHUB_TOKEN }} | docker login ... --password-stdin with docker/login-action@v3
  • Remove unused IMAGE_REGISTRY and REGISTRY_USER env vars

rollback.yaml — bug fix

  • Fixed: docker push $API_IMAGE:production was referencing ghcr.io/equinor/neqsimapi (a hardcoded wrong image) instead of ${{ matrix.image }}. The push now correctly uses the matrix image variable.

Why

  • docker/login-action handles credential masking, error handling, and automatic logout
  • Eliminates risk of token leakage in logs if the shell command fails
  • Consistent with GitHub Actions best practices
  • Uses ${{ github.actor }} (Actions expression) instead of $GITHUB_ACTOR (shell env var)

@einarwar einarwar requested a review from a team as a code owner March 27, 2026 13:37
@einarwar einarwar requested a review from sindre-nistad March 27, 2026 13:37
- Replace 'echo $TOKEN | docker login' with docker/login-action@v3
  across publish-image, tests, and rollback workflows
- Remove unused IMAGE_REGISTRY and REGISTRY_USER env vars
- Fix rollback bug: docker push was using wrong image var ($API_IMAGE
  pointed to neqsimapi instead of ${{ matrix.image }})
@einarwar einarwar force-pushed the ci/use-docker-login-action branch from 279f703 to 03fb858 Compare March 27, 2026 14:21
@einarwar einarwar requested a review from sutne March 27, 2026 14:21
Copy link
Copy Markdown
Contributor

@sutne sutne left a comment

Choose a reason for hiding this comment

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

LGTM! ✨

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