Skip to content

Fix Scorecard authentication with GITHUB_TOKEN - #15

Merged
Liang-Chun Tsai (ltsai-dev) merged 6 commits into
mainfrom
ltsai-microsoft-fix-scorecard-github-token
Aug 17, 2026
Merged

Fix Scorecard authentication with GITHUB_TOKEN#15
Liang-Chun Tsai (ltsai-dev) merged 6 commits into
mainfrom
ltsai-microsoft-fix-scorecard-github-token

Conversation

@ltsai-dev

Copy link
Copy Markdown
Contributor

Summary

The weekly OpenSSF Scorecard scan stopped working because its personal access token violated the enterprise expiration policy and then expired. This switches the scan to GitHub Actions' automatic short-lived token, eliminating manual token rotation.

Changes

  • Grant the documented private-repository read permissions to the Scorecard job.
  • Remove the SCORECARD_TOKEN input so Scorecard uses the workflow-issued GITHUB_TOKEN.
  • Upgrade ossf/scorecard-action from v2.4.3 to v2.4.4.

Test plan

Ran the exact Scorecard v2.4.4 container in GitHub Actions with the workflow-issued token against main. The analysis completed successfully and produced non-empty SARIF: https://github.com/microsoft/thinkingbox/actions/runs/32049075473

The first attempts coincided with GitHub's August 17 API/Actions outage and returned GraphQL 503 responses; the unchanged validation passed after service recovery.

Related issues

N/A

Liang-Chun Tsai added 6 commits August 17, 2026 10:02
Use the workflow GITHUB_TOKEN for private repository scans and add the documented read permissions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
Scorecard only supports execution from the default branch, so keep push scans scoped to main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
Run the v2.4.4 container against main with the workflow-issued GITHUB_TOKEN without changing the default branch.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
Mount the Actions event payload into the container and target the default branch for the isolated token test.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
Allow the isolated Scorecard check to survive temporary GitHub API 503 responses while still failing persistent authentication or analysis errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
The workflow-issued GITHUB_TOKEN completed the v2.4.4 analysis and produced SARIF, so remove the branch-only validation harness.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 22274a22-19ba-4b95-be2e-cbd4ea21f65e
@ltsai-dev
Liang-Chun Tsai (ltsai-dev) merged commit 3fe31b6 into main Aug 17, 2026
5 checks passed
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.

1 participant