Skip to content

Skip DockerHub login on Dependabot PRs - #448

Open
mattjala wants to merge 1 commit into
HDFGroup:masterfrom
mattjala:fix/docker-login-dependabot
Open

Skip DockerHub login on Dependabot PRs#448
mattjala wants to merge 1 commit into
HDFGroup:masterfrom
mattjala:fix/docker-login-dependabot

Conversation

@mattjala

Copy link
Copy Markdown
Contributor

The Docker Image CI workflow fails on every Dependabot PR with an auth error at the login to DockerHub step.

docker/login-action is given secrets.DOCKERHUB_USERNAME / DOCKERHUB_PASSWORD. When those resolve to empty strings it attempts the job anyway (and fails).

Two kinds of run cannot see those secrets:

  • PRs from forks. GitHub withholds secrets from untrusted contributors. This case is already prevented from trying to login by the existing ! github.event.pull_request.head.repo.fork check.
  • Dependabot PRs. GitHub resolves secrets.* for Dependabot-triggered runs against a separate Dependabot secret store, not the Actions store.

Because Dependabot branches live in this repo, the existing check lets Dependabot PRs try to login to DockerHub.

This isn't a problem for regular contributors because they either have write access and push a branch here (have secret access & login succeeds) or open a PR from a fork (no secret access & no login attempt).

This PR extends the existing condition to also skip Dependabot.

Fixes #315

Fixes HDFGroup#315.

The `Docker Image CI` workflow fails on every Dependabot PR with an auth
error at the login to DockerHub step.

`docker/login-action` is given `secrets.DOCKERHUB_USERNAME` /
`DOCKERHUB_PASSWORD`. When those resolve to empty strings it
attempts the job anyway (and fails).

Two kinds of run cannot see those secrets:

* PRs from forks. GitHub withholds secrets from untrusted contributors.
  This case is already prevented from trying to login by the existing
  `! github.event.pull_request.head.repo.fork` check.
* Dependabot PRs. GitHub resolves `secrets.*` for Dependabot-triggered
  runs against a separate Dependabot secret store, not the Actions
  store.

Because Dependabot branches live in this repo, the existing check
lets Dependabot PRs try to login to DockerHub.

This isn't a problem for regular contributors because they either have write access and
push a branch here (have secret access & login succeeds) or open a PR from a
fork (no secret access & no login attempt).

This PR extends the existing condition to also skip Dependabot.
@mattjala mattjala added bug ci/cd Issues related to the CI/CD setup and execution labels Aug 13, 2026
@mattjala
mattjala requested a review from lrknox August 14, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci/cd Issues related to the CI/CD setup and execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker Image CI fails intermittently due to bad username/password

1 participant