Skip to content

Resilient PR homepage screenshot publishing with token fallback#110

Open
crazygo wants to merge 1 commit into
mainfrom
codex/fix-github_token-error-in-script
Open

Resilient PR homepage screenshot publishing with token fallback#110
crazygo wants to merge 1 commit into
mainfrom
codex/fix-github_token-error-in-script

Conversation

@crazygo
Copy link
Copy Markdown
Collaborator

@crazygo crazygo commented Apr 2, 2026

Motivation

  • Prevent the PR Frontend E2E workflow from failing when a custom PAT-like secret is not configured for publishing PR homepage screenshots.
  • Allow the publish step to use the built-in GitHub token as a fallback so screenshot generation and artifact upload are not marked as failures.
  • Improve observability by emitting a clear warning when no token is available instead of throwing an error.

Description

  • Change .github/scripts/publish_pr_homepage_screenshot.js to not throw when no token is present; it now logs a warning and exits successfully when GITHUB_TOKEN/GH_TOKEN is missing.
  • Update .github/workflows/pr_frontend_e2e.yml to set GITHUB_TOKEN for the publish step from the fallback chain secrets.GH_TOKEN || github.token instead of secrets.CRAZYGO_PAT.
  • Add docs/plans/2026-04-02-14-20-UTC-pr-homepage-screenshot-token-fallback.md documenting the background, goals, plan, and acceptance criteria for the change.

Testing

  • Ran node --check .github/scripts/publish_pr_homepage_screenshot.js to validate the script syntax and it succeeded.
  • Confirmed that the change is limited to environment handling and script exit behavior so CI job artifacts and previous screenshot steps remain unaffected during manual verification.

Codex Task

Copilot AI review requested due to automatic review settings April 2, 2026 23:06
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bricks Ready Ready Preview, Comment Apr 2, 2026 11:08pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves the resilience of the “PR Frontend E2E” workflow’s PR-comment screenshot publishing by falling back to the built-in GitHub token and making the publish script non-fatal when no token is available.

Changes:

  • Updated the PR E2E workflow to set GITHUB_TOKEN via secrets.GH_TOKEN || github.token for the publish step.
  • Updated the publish script to warn and exit successfully when no token is present (instead of throwing).
  • Added a short plan doc describing the motivation, phased plan, and acceptance criteria.

Reviewed changes

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

File Description
docs/plans/2026-04-02-14-20-UTC-pr-homepage-screenshot-token-fallback.md Documents the background, goals, implementation phases, and acceptance criteria for token fallback/resilience.
.github/workflows/pr_frontend_e2e.yml Switches screenshot publishing auth from a custom PAT secret to `secrets.GH_TOKEN
.github/scripts/publish_pr_homepage_screenshot.js Skips publishing with a warning when no token is set, avoiding workflow failure in that scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants