Skip to content

ci: add repository guard to Docker and Release workflows - #39

Open
pmady wants to merge 1 commit into
dragonflyoss:mainfrom
pmady:fix/docker-workflow-fork-guard
Open

ci: add repository guard to Docker and Release workflows#39
pmady wants to merge 1 commit into
dragonflyoss:mainfrom
pmady:fix/docker-workflow-fork-guard

Conversation

@pmady

@pmady pmady commented Apr 6, 2026

Copy link
Copy Markdown

What this PR does

Adds if: github.repository == 'dragonflyoss/dragonfly-injector' guard to the docker and release workflow jobs to prevent them from running on forks, where Docker Hub secrets are unavailable and cause CI failures.

Fixes: #15

Changes

  • .github/workflows/docker.yml — add repository check at job level
  • .github/workflows/release.yml — add repository check at job level

Why

Forks don't have DOCKER_USERNAME / DOCKER_PASSWORD secrets, so the Docker Publish workflow fails on every push to a fork's main branch. The guard skips these jobs entirely on forks, saving CI time and avoiding red ❌s.

@pmady
pmady requested a review from a team as a code owner April 6, 2026 21:37
@github-actions
github-actions Bot requested review from gaius-qi and yyzai384 April 6, 2026 21:37
@gaius-qi gaius-qi added the enhancement New feature or request label Apr 7, 2026
@pmady

pmady commented May 4, 2026

Copy link
Copy Markdown
Author

@gaius-qi friendly ping on this - pretty small change, just adds repository guards to the docker and release workflows so forks dont trigger them unnecessarily

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

This PR is stale because it has been open 120 days with no activity.

@github-actions github-actions Bot added the stale label Sep 2, 2026
Add 'if: github.repository == dragonflyoss/dragonfly-injector' guard
to docker and release workflow jobs to prevent them from running on
forks, where secrets are unavailable and cause CI failures.

Fixes: dragonflyoss#15
Signed-off-by: pmady <pavan4devops@gmail.com>
@pmady
pmady force-pushed the fix/docker-workflow-fork-guard branch from e42f54d to bb64b97 Compare September 8, 2026 17:36
@pmady

pmady commented Sep 8, 2026

Copy link
Copy Markdown
Author

rebased on main, still the same two lines. @gaius-qi this one and #31 are what im presenting on the maintainer track at kubecon NA in november, would be good to have them in before then. lmk if you want anything changed

@github-actions github-actions Bot removed the stale label Sep 9, 2026

@chlins chlins left a comment

Copy link
Copy Markdown
Member

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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build and Push Docker Image workflow fails on forks

3 participants