Skip to content

Fix Clean Workflow Logs action: replace broken third-party action with gh CLI#1978

Merged
RobertvanderHulst merged 1 commit into
mainfrom
copilot/fix-clear-workflow-logs-error
Jun 7, 2026
Merged

Fix Clean Workflow Logs action: replace broken third-party action with gh CLI#1978
RobertvanderHulst merged 1 commit into
mainfrom
copilot/fix-clear-workflow-logs-error

Conversation

Copilot AI commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The igorjs/gh-actions-clean-workflow@v7 action rejects ${{ github.token }} due to overly strict token prefix validation, failing every run with:

[Invalid Parameter] <token> must be a valid GitHub token (ghp_, ghs_, or github_pat_)

Replaced the third-party action with a native gh CLI script that authenticates via GH_TOKEN env var — no prefix validation, no external dependency.

  • Uses GitHub REST API created=<date filter to find runs older than 90 days
  • Paginates and deletes in a loop with per-run error reporting
  • Eliminates dependency on a third-party action with an upstream bug

…h gh CLI script

The igorjs/gh-actions-clean-workflow@v7 action rejects the GitHub Actions
token (${{ github.token }}) due to overly strict token prefix validation,
causing every run to fail with:
"[Invalid Parameter] <token> must be a valid GitHub token (ghp_, ghs_, or github_pat_)"

Replace with a native gh CLI script that uses the pre-installed GitHub CLI
on ubuntu-latest runners. The gh CLI handles authentication via GH_TOKEN
environment variable without any prefix validation issues.
@RobertvanderHulst RobertvanderHulst marked this pull request as ready for review June 7, 2026 13:55
Copilot AI review requested due to automatic review settings June 7, 2026 13:55
@RobertvanderHulst RobertvanderHulst merged commit 3bce13d into main Jun 7, 2026
0 of 2 checks passed

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@RobertvanderHulst RobertvanderHulst deleted the copilot/fix-clear-workflow-logs-error branch June 7, 2026 14:03
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.

3 participants