Skip to content

ci: fallback to GITHUB_TOKEN in scorecard analysis when SCORECARD_READ_TOKEN is unavailable - #5510

Open
adri22235 wants to merge 4 commits into
microsoft:mainfrom
adri22235:fix/scorecard-token-fallback
Open

ci: fallback to GITHUB_TOKEN in scorecard analysis when SCORECARD_READ_TOKEN is unavailable#5510
adri22235 wants to merge 4 commits into
microsoft:mainfrom
adri22235:fix/scorecard-token-fallback

Conversation

@adri22235

Copy link
Copy Markdown

Description

Resolves a CI failure where the Scorecards analysis workflow fails with 401 Bad credentials on push/forks if SCORECARD_READ_TOKEN is expired or unavailable:

scorecard had an error: repo unreachable: GET https://api.github.com/repos/microsoft/ebpf-for-windows: 401 Bad credentials []

This change updates the repo_token to fall back to ${{ secrets.SCORECARD_READ_TOKEN || secrets.GITHUB_TOKEN }}, ensuring that the workflow can always authenticate with the GitHub Actions default token while maintaining support for dedicated tokens when available.
Testing

    Verified syntax against .github/workflows/scorecards-analysis.yml.

    Verified required job permissions (security-events: write, id-token: write, contents: read) are already present for GITHUB_TOKEN.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Scorecards GitHub Actions workflow to avoid authentication failures by falling back to the default Actions token when a dedicated Scorecards read token isn’t available, improving CI reliability for Scorecards analysis in the eBPF for Windows repo.

Changes:

  • Update ossf/scorecard-action repo_token to use ${{ secrets.SCORECARD_READ_TOKEN || secrets.GITHUB_TOKEN }} as a fallback mechanism.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/scorecards-analysis.yml
@github-actions

Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants