Skip to content

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

Description

@AndreasIgel

When opening a pull request from a fork, several workflow steps fail because the required secrets/repository settings are not available in the fork:

  1. maven.yml / SonarCloud Analysis and Codecov uploads

    • The SonarCloud Analysis step runs unconditionally (except for Dependabot) and fails with:
      ERROR - Commit creating failed: {"message":"Token required - not valid tokenless upload"}
      
    • The Upload test results to Codecov and Upload coverage to Codecov steps also require CODECOV_TOKEN and fail with the same tokenless-upload error.
    • This makes the build check fail for every fork PR even though the Maven build and tests pass.
  2. dependency-review.yml / Dependency review

    • The action fails on forks with:
      Dependency review is not supported on this repository. Please ensure that Dependency graph is enabled
      
    • Forks usually do not have the dependency graph enabled, so this check cannot succeed.

Suggested fix

  • Expose SONAR_TOKEN and CODECOV_TOKEN as job-level environment variables in maven.yml and gate the Sonar/Codecov steps on them being non-empty, so they are skipped on fork PRs where the secrets are withheld.
  • Add an if: github.event.repository.fork == false guard (or similar) to the dependency-review job so it does not run on forks.

This keeps the CI green for fork contributors without changing the behaviour in the upstream repository, where the secrets and dependency graph are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions