Skip to content

ci: skip dependency-review job on fork repositories (#243) - #255

Merged
AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:devin/fix-issue-243-ci-fork-secrets
Aug 16, 2026
Merged

ci: skip dependency-review job on fork repositories (#243)#255
AndreasIgel merged 2 commits into
java-helpers:mainfrom
AndreasIgel:devin/fix-issue-243-ci-fork-secrets

Conversation

@AndreasIgel

Copy link
Copy Markdown
Collaborator

Fixes #243.

Summary

The dependency-review GitHub Action requires the repository's dependency graph to be enabled. Forks typically do not have this feature enabled, so the action fails on every fork PR. The maven.yml SonarCloud and Codecov upload steps are already gated on the presence of SONAR_TOKEN and CODECOV_TOKEN (they are exposed as job-level env variables and skipped when empty for fork PRs).

Changes

  • Add if: github.event.repository.fork == false to the dependency-review job so it only runs on the upstream/non-fork repository where the dependency graph is available.

Note

Because this workflow uses pull_request_target, the dependency-review check on this PR itself still runs from the main branch workflow file (which does not yet contain the guard). The skip will be active for all subsequent PRs once this change is merged.

This keeps fork PRs green without affecting the upstream repository's security scanning.

@AndreasIgel
AndreasIgel merged commit d0270ff into java-helpers:main Aug 16, 2026
5 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/fix-issue-243-ci-fork-secrets branch August 16, 2026 21:08
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.

CI workflow steps fail on fork pull requests due to missing secrets and dependency graph

1 participant