Skip to content

ci(scorecard): keep a failing API call from taking the workflow down - #60

Merged
msalvatti merged 4 commits into
mainfrom
ci/harden-visibility-gate
Aug 7, 2026
Merged

ci(scorecard): keep a failing API call from taking the workflow down#60
msalvatti merged 4 commits into
mainfrom
ci/harden-visibility-gate

Conversation

@msalvatti

Copy link
Copy Markdown
Member

Hardens the visibility gate added earlier in this sweep. Raised in review on the sibling pull requests, and applied everywhere the same step landed.

The defect

The step ran under set -euo pipefail around a single gh api call. A rate limit, a brief outage or a token hiccup failed the job — and with it Scorecard, on a public repository, where it should have run. The gate exists to skip work that cannot succeed; instead it could stop work that would have.

The fix

Three attempts with a growing pause. If visibility still cannot be determined, the step emits a ::warning:: and treats the repository as non-public rather than failing.

A red workflow over a transient API error is noise that trains people to ignore red. A warning is visible in the run summary and does not.

Also

  • the job condition is wrapped in ${{ }}, matching the condition it replaced
  • the comment says "non-public" where it said "private"; the rule covers internal repositories too

Job names, permissions, the action pin and the trigger set are unchanged.

The visibility step ran under `set -e` with a single `gh api` call, so a
rate limit or a blip failed the job and stopped Scorecard from running even on
a public repository. It now retries and, failing that, warns and treats the
repository as non-public.

Also wraps the job condition in `${{ }}` and says "non-public" where the
comment said "private", since the rule covers internal repositories too.
Copilot AI lite review requested due to automatic review settings August 7, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown

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 hardens the Scorecard workflow’s “repository visibility” gate so transient GitHub API failures don’t fail the entire workflow, while still preventing Scorecard publication steps from running when repository visibility can’t be confirmed.

Changes:

  • Reworks the visibility check to retry the gh api call up to 3 times with incremental backoff and degrade to “not public” with a warning if visibility can’t be determined.
  • Updates messaging to reflect “non-public” (covers internal + private) and simplifies the notice text.
  • Wraps the analysis job condition in ${{ }} to match the condition style it replaced.

Both raised in review. Dropping -e to let the retry loop run also disabled
error checking for the rest of the step: a failed write to $GITHUB_OUTPUT
would have gone unnoticed and skipped the scan silently. A command inside an
`if` condition is exempt from -e, so the retry works with it still on, and
the final attempt no longer sleeps before giving up.

The skip notice said what happened but not why. The reason is a licensing
one and is not obvious to whoever reads the run.
Copilot AI review requested due to automatic review settings August 7, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

The repository checks formatting over workflow files, and the edit did not
match what prettier produces. It took the Lint job and the aggregate gate
down with it.
Copilot AI review requested due to automatic review settings August 7, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Raised in review. The notice said "licence"; GitHub's product term is
"GitHub Code Security license", and these repositories use "license"
everywhere else. A log line that spells the product differently reads as a
typo and does not match a search for the term.
Copilot AI review requested due to automatic review settings August 7, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@msalvatti
msalvatti merged commit 21966d3 into main Aug 7, 2026
24 checks passed
@msalvatti
msalvatti deleted the ci/harden-visibility-gate branch August 7, 2026 21:57
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.

2 participants