Skip to content

feat: add token health check composite action - #155

Merged
castrojo merged 1 commit into
mainfrom
ci/phase4-token-health
Jun 10, 2026
Merged

feat: add token health check composite action#155
castrojo merged 1 commit into
mainfrom
ci/phase4-token-health

Conversation

@castrojo

Copy link
Copy Markdown
Contributor

Summary

Automation audit Phase 4: composite action that validates a GitHub token is healthy before workflows depend on it.

Addresses FM3 (token expiry silent failures) from the automation audit.

Usage:

- uses: projectbluefin/actions/actions/check-token-health@<sha>
  with:
    token: ${{ secrets.RENOVATE_TOKEN }}
    token_name: RENOVATE_TOKEN
    required_scopes: repo,workflow

Checks:

  1. HTTP auth (401/403 fast-fail with clear error message)
  2. OAuth scope validation against required list
  3. Rate limit remaining (warning if below threshold)
  4. Token expiry detection (for GitHub App installation tokens)

Closes #583 (Phase 4 of automation audit).

Assisted-by: Claude Sonnet 4.5 via pi

Validates a GitHub token (PAT or App) is healthy before workflows
depend on it. Checks: HTTP auth (401/403 fast-fail), OAuth scopes,
rate limit remaining, and token expiry (for App installation tokens).

Addresses FM3 from automation audit (token expiry silent failures).

Assisted-by: Claude Sonnet 4.5 via pi
@castrojo
castrojo requested a review from p5 as a code owner June 10, 2026 23:32
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@castrojo
castrojo merged commit 265c8f8 into main Jun 10, 2026
9 checks passed
castrojo added a commit that referenced this pull request Jun 11, 2026
* ci(actions): wire check-token-health into reusable-renovate.yml

Add RENOVATE_TOKEN validation as the first step in the Renovate job.
The check-token-health composite action (added in #155) now gates the
Renovate run — invalid or expired tokens fail fast with a clear error
instead of cascading silently.

Assisted-by: claude-sonnet-4.6 via pi

* docs(skills): add consumer-validation body format pitfall

Document the critical pitfall: PR bodies using markdown headings
(## Consumer PR) instead of the colon format (Consumer PR: <URL>)
cause silent failures in the consumer validation CI check.

Add guidance for creating consumer PRs via GitHub API for internal-only
reusable workflows (like reusable-renovate.yml) that don't have direct
consumer callers but still trigger the validation check.

Assisted-by: claude-sonnet-4.6 via pi

---------

Co-authored-by: Jorge Castro <jorge@castrojo.com>
@github-actions
github-actions Bot deleted the ci/phase4-token-health branch June 15, 2026 05:48
@castrojo castrojo added 4-review A pull request is awaiting review. and removed pr/needs-review labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4-review A pull request is awaiting review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant