Skip to content

ci: skip Docker Hub login on PRs from forks#4304

Merged
tasuku43 merged 1 commit into
masterfrom
fix-integration-fork-pr-login
May 20, 2026
Merged

ci: skip Docker Hub login on PRs from forks#4304
tasuku43 merged 1 commit into
masterfrom
fix-integration-fork-pr-login

Conversation

@tasuku43
Copy link
Copy Markdown
Contributor

@tasuku43 tasuku43 commented May 20, 2026

Summary

  • GitHub Actions does not expose secrets to workflows triggered by PRs from forked repositories. As a result, docker/login-action in the test job fails with Username and password required for external contributors' PRs (see PR #4292 run).
  • Skip the Docker Hub login step when the PR head repo is not this repository.
  • The push and manifest jobs are guarded by if: github.ref_name == 'master' and never run on fork PRs, so they are unaffected.

Why skipping the login is safe for the test job

  • The test job only runs make build / make test and never pushes, so authentication is not strictly required.
  • All base images referenced by Dockerfile* in this repository are public — Docker Hub library images (alpine, ubuntu, mysql, python, ruby, node, debian, busybox, docker, ...), public vendor images (amazon/aws-cli, datadog/..., confluentinc/..., crossplane/..., summerwind/actions-runner, adoptopenjdk/*, circleci/*, fluent/fluentd, curlimages/curl), GHCR (ghcr.io/actions/actions-runner), Quay (quay.io/argoproj/argocd), and the project's own publicly-pushed chatwork/* images. None of them require authentication.
  • Without login, anonymous pulls are subject to Docker Hub's rate limit, but the impact is limited because this only affects fork PRs (internal PRs and pushes to master still log in as before). If it ever becomes a real problem we can revisit (e.g. registry mirror, or asking maintainers to retrigger CI from an internal branch).

GitHub Actions does not expose secrets to workflows triggered by PRs
from forked repositories, so docker/login-action fails with "Username
and password required" (e.g. PR #4292). Skip the login step when the
PR head repo is not this repository; anonymous pulls still work, and
push/manifest jobs are unaffected because they only run on master.
Copy link
Copy Markdown
Contributor

@kb-hiroyaataka kb-hiroyaataka left a comment

Choose a reason for hiding this comment

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

LGTM!

@tasuku43 tasuku43 merged commit c714156 into master May 20, 2026
4 checks passed
@tasuku43 tasuku43 deleted the fix-integration-fork-pr-login branch May 20, 2026 00:27
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