Skip to content

fix: scorecard dev-push failure and gpg-verify logic bugs#72

Merged
Sandy-at-Tazama merged 1 commit intodevfrom
fix/scorecard-gpg-verify
Apr 6, 2026
Merged

fix: scorecard dev-push failure and gpg-verify logic bugs#72
Sandy-at-Tazama merged 1 commit intodevfrom
fix/scorecard-gpg-verify

Conversation

@Justus-at-Tazama
Copy link
Copy Markdown
Contributor

Port of tazama-lf/workflows#46. Identical fixes applied to both repos.

scorecard.yml

ossf/scorecard-action@v2.4.3 enforces a hard constraint that it can only run on the repository's default branch. Triggering on dev fails immediately with Only the default branch main is supported.

Fix: Remove dev from push.branches. Triggers are now push: [main], schedule (weekly), branch_protection_rule.

gpg-verify.yml

Three bugs fixed:

1. Actor exclusion incompletegithub-actions[bot] was not excluded. Automated sync PRs always failed GPG check because the bot cannot sign commits.

2. Inverted git log range

# Before (wrong)
git log origin/${PR_HEAD_REF}..origin/${PR_BASE_REF}
# After (correct)
git log origin/${PR_BASE_REF}..origin/${PR_HEAD_REF}

3. Wrong API endpoint — was querying /commits/:sha/check-runs for a check named "GPG verify" (circular self-reference, returns empty on first run). Now uses /commits/:sha.commit.verification.verified, which is the correct server-side GPG verification result.

Bonus: Empty commit range guard added (exits 0 cleanly instead of looping over nothing).

Port of tazama-lf/workflows#46.

scorecard.yml (mirrors tazama-lf/workflows#44):
- Remove 'dev' from push.branches trigger. ossf/scorecard-action@v2.4.3
  enforces that it can only run on the default branch regardless of
  publish_results; triggering on dev fails with 'Only the default branch
  main is supported'.

gpg-verify.yml (mirrors tazama-lf/workflows#45):
- Add github-actions[bot] to actor exclusion -- automated PRs from the
  sync workflow use this identity and cannot have GPG-signed commits.
- Fix inverted git log range: origin/${PR_BASE_REF}..origin/${PR_HEAD_REF}
  (was backwards: listed base-only commits, not PR commits).
- Replace check-runs API call (circular self-reference) with the commit
  verification endpoint GET /repos/.../commits/:sha and check
  .commit.verification.verified (boolean).
- Guard against empty commit range (exit 0 cleanly).
@github-actions github-actions Bot added the bug Something isn't working label Apr 6, 2026
@Sandy-at-Tazama Sandy-at-Tazama self-requested a review April 6, 2026 13:13
@Sandy-at-Tazama Sandy-at-Tazama merged commit 241cf27 into dev Apr 6, 2026
2 checks passed
@Sandy-at-Tazama Sandy-at-Tazama deleted the fix/scorecard-gpg-verify branch April 6, 2026 13:14
Justus-at-Tazama added a commit that referenced this pull request Apr 8, 2026
Applies all changes from tazama-lf/workflows PR #76 (workflow audit fixes - batch 1)
to frmscoe/workflows. Changes are synced verbatim from the canonical source.

- fix(njsscan): fix SARIF upload guard, category, upgrade upload-sarif v4 (#68)
- fix(gpg-verify): make curl error handler reachable under bash -e (#69)
- fix(dco-check, gpg-verify): replace mutable branch refs with immutable SHAs (#70)
- fix(package-rule): add ref guard to prevent push from non-canonical branches (#71)
- fix(gpg-verify): rename workflow to Signature Verify, update header comment (#72)
- fix(package-rule): pass GH_TOKEN to docker build via BuildKit secret (#73)
- fix(sbom): pass GH_TOKEN to docker build via BuildKit secret (#74)
- fix(dockerfile-linter): skip hadolint and upload when no Dockerfile present (#75)
- fix(dockerfile-linter, sbom): address CodeRabbit review findings

Signed-off-by: Justus-at-Tazama <jortlepp@contractor.linuxfoundation.org>
Justus-at-Tazama added a commit that referenced this pull request Apr 8, 2026
Applies all changes from tazama-lf/workflows PR #76 (workflow audit fixes - batch 1)
to frmscoe/workflows. Changes are synced verbatim from the canonical source.

- fix(njsscan): fix SARIF upload guard, category, upgrade upload-sarif v4 (#68)
- fix(gpg-verify): make curl error handler reachable under bash -e (#69)
- fix(dco-check, gpg-verify): replace mutable branch refs with immutable SHAs (#70)
- fix(package-rule): add ref guard to prevent push from non-canonical branches (#71)
- fix(gpg-verify): rename workflow to Signature Verify, update header comment (#72)
- fix(package-rule): pass GH_TOKEN to docker build via BuildKit secret (#73)
- fix(sbom): pass GH_TOKEN to docker build via BuildKit secret (#74)
- fix(dockerfile-linter): skip hadolint and upload when no Dockerfile present (#75)
- fix(dockerfile-linter, sbom): address CodeRabbit review findings

Signed-off-by: Justus-at-Tazama <jortlepp@contractor.linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants