Skip to content

removed#137

Closed
PazerOP wants to merge 10 commits intorossjrw:mainfrom
PazerOP:claude/fix-deploy-branch-check-nRRVE
Closed

removed#137
PazerOP wants to merge 10 commits intorossjrw:mainfrom
PazerOP:claude/fix-deploy-branch-check-nRRVE

Conversation

@PazerOP
Copy link
Copy Markdown

@PazerOP PazerOP commented Mar 29, 2026

removed

PazerOP and others added 10 commits March 28, 2026 08:00
* Rewrite action for GitHub Actions artifact-based Pages deployment

Replace bash scripts with TypeScript (ts-node), remove "Deploy from branch"
code path entirely. The action now uses actions/upload-pages-artifact +
actions/deploy-pages for synchronous deployment.

Key changes:
- Replace all lib/*.sh with src/*.ts (setup, comment, status, github API helper)
- Remove inputs: deploy-repository, wait-for-pages-deployment, custom-url
- Add inputs: commit-status, commit-status-context
- Add cache-busted preview URLs (?v={short_sha}) in comments and statuses
- Replace marocchino/sticky-pull-request-comment with direct GitHub API calls
- Add wow-look-at-my/actions@no-scripts-action check to CI
- Update README for artifact-based deployment setup

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Move inline JSON test data to fixture files

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Remove commit-status input, always set commit statuses

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Merge preview-url-cached into preview-url

preview-url now always includes the ?v={short_sha} cache-busting param.

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Remove git-config-name/email inputs, hardcode bot identity

The gh-pages branch is internal bookkeeping, not user-facing.

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Replace JamesIves/github-pages-deploy-action with plain git operations

Drop the external dependency entirely. Deploy and remove steps now use
inline git clone + cp/rm + commit + push to manage the gh-pages branch
directly. Also removes the empty_dir_path temp directory that was only
needed for JamesIves's "remove" flow.

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Add packageManager field and install pnpm/Node in action steps

pnpm/action-setup@v4 requires the pnpm version to be specified either
via version input or packageManager in package.json. Also add
pnpm/action-setup and setup-node steps to the composite action so it
works on runners that don't already have pnpm installed.

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Use actions/checkout for gh-pages branch instead of manual git clone

Simplifies the deploy and remove steps by using actions/checkout to get
the preview branch. Falls back to orphan branch init if the branch
doesn't exist yet (first deploy).

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Extract git branch operations into src/git-update.ts

Move clone/init, file copy/delete, commit, and push logic into a
reusable TypeScript script. The main action.yml now just passes env
vars and calls git-update.ts with "deploy" or "remove" mode.

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Update action author to credit original while noting fork

https://claude.ai/code/session_0131TjEnMfheEvptY2NJNSA1

* Add reusable workflow, pre-compile TypeScript to JS (#2)

* Add reusable workflow, pre-compile TypeScript to JS

Convert from requiring callers to manually configure permissions,
concurrency, checkout, and token passing to a reusable workflow that
handles all of that internally. Callers now just need:

  uses: PazerOP/pr-preview-action/.github/workflows/preview.yml@v1
  with:
    source-dir: ./build/
  secrets: inherit

Also pre-compiles TypeScript to dist/ so the action no longer needs
pnpm, ts-node, or npm install at runtime — just node (already on
all GitHub-hosted runners).

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Remove preview-example.yml, example is in README

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Generate QR codes locally instead of phoning home to external service

Replace the external QR code provider URL (qr.rossjrw.com) with local
generation using the qrcode npm package + ImageMagick PNG-to-GIF
conversion. QR code is embedded as a base64 data URI in the comment.

GIF is used because QR codes are 1-bit images and GIF's palette
compression handles that perfectly (727 bytes vs 1413 for PNG).

Also removes redundant pages-base-url and preview-url-path outputs
from the reusable workflow — preview-url has all the info callers need.

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Use proper boolean types for comment and qr-code workflow inputs

Reusable workflows support boolean type natively. No reason to use
string "true"/"false" when the real type is available.

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Delete action.yml and dead files

- action.yml: no users, reusable workflow replaces it
- deploy-example.yml: unrelated to PR previews
- test-integration.yml: tested the deleted composite action
- comment-generated.md: test artifact, now gitignored
- ts-node/typescript: moved to devDependencies (only needed for build)

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Fix CI: remove scripts from package.json, fix QR test assertion

- No scripts check fails because package.json had a scripts section.
  Removed it — tsc is called directly in CI.
- Unit test asserted GIF specifically but ImageMagick isn't on runners.
  Test now accepts either GIF or PNG data URI.

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Restore integration tests, replace uses: ./ with direct script calls

The composite action is gone, so integration tests now call
dist/setup.js and dist/git-update.js directly via a small
test helper (test/lib/run-preview.sh) instead of uses: ./

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

* Rewrite integration tests to use the reusable workflow directly

- Integration tests now call .github/workflows/preview.yml as job chains
  instead of using the deleted composite action or helper scripts
- Add deploy-to-pages input to reusable workflow for git-only test runs
- Fix fork safety check to work for non-PR events (workflow_call)
- Fix concurrency key to scope per-PR
- Handle skipped pages-deploy outcome in success conditions
- Create static test fixtures with baked-in markers (no runtime sed)
- Delete run-preview.sh wrapper (replaced by reusable workflow)

https://claude.ai/code/session_01UZkyGvYfydgNiBWis9gisp

---------

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
- actions/checkout v4 → v6
- actions/deploy-pages v4 → v5
- actions/setup-node v4 → v6

Resolves Node.js 20 deprecation warning (removal Sept 2026).

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

Co-authored-by: Claude <noreply@anthropic.com>
* Fix missing qrcode dependency by installing action deps in workflow

The dist/ files are tsc output (not bundled), so external dependencies
like qrcode need to be installed at runtime. Added npm install step
after checking out the action source.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Use sparse checkout for caller repo to only fetch source-dir

For large repos (e.g. Unreal Engine with 183k files), a full checkout
is wasteful when only a small directory like demo/ is needed. The
action already knows which directory it needs via source-dir input.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Claude/resolve merge conflicts e j jyt (#5)

* Update GitHub Actions to Node.js 24 compatible versions

- actions/checkout v4 → v6
- actions/deploy-pages v4 → v5
- actions/setup-node v4 → v6

Resolves Node.js 20 deprecation warning (removal Sept 2026).

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Fix missing qrcode dependency by installing action deps in workflow

The dist/ files are tsc output (not bundled), so external dependencies
like qrcode need to be installed at runtime. Added npm install step
after checking out the action source.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Use sparse checkout for caller repo to only fetch source-dir

For large repos (e.g. Unreal Engine with 183k files), a full checkout
is wasteful when only a small directory like demo/ is needed. The
action already knows which directory it needs via source-dir input.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

---------

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
* Fix missing qrcode dependency by installing action deps in workflow

The dist/ files are tsc output (not bundled), so external dependencies
like qrcode need to be installed at runtime. Added npm install step
after checking out the action source.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Use sparse checkout for caller repo to only fetch source-dir

For large repos (e.g. Unreal Engine with 183k files), a full checkout
is wasteful when only a small directory like demo/ is needed. The
action already knows which directory it needs via source-dir input.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Claude/resolve merge conflicts e j jyt (#5)

* Update GitHub Actions to Node.js 24 compatible versions

- actions/checkout v4 → v6
- actions/deploy-pages v4 → v5
- actions/setup-node v4 → v6

Resolves Node.js 20 deprecation warning (removal Sept 2026).

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Fix missing qrcode dependency by installing action deps in workflow

The dist/ files are tsc output (not bundled), so external dependencies
like qrcode need to be installed at runtime. Added npm install step
after checking out the action source.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

* Use sparse checkout for caller repo to only fetch source-dir

For large repos (e.g. Unreal Engine with 183k files), a full checkout
is wasteful when only a small directory like demo/ is needed. The
action already knows which directory it needs via source-dir input.

https://claude.ai/code/session_01NXiB1PBDKqBNDb2uwSomza

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix: add assert_file_not_contains so negative assertions fail the build

The negative QR code assertion used `assert_file_contains ... && exit 1 || true`
which suppressed all errors on that line, preventing test failures from
propagating to the build. Replace with a proper assert_file_not_contains
function.

https://claude.ai/code/session_018Lc1cKLf89mGtKj5fvpQ5V

---------

Co-authored-by: Claude <noreply@anthropic.com>
Inject a small script into HTML files during deploy that carries the
?v=<sha> query parameter to all relative links on click, so navigating
within a multi-page preview doesn't lose the cache buster.

https://claude.ai/code/session_01VLy8uxJGgcByefhNpeY124

Co-authored-by: Claude <noreply@anthropic.com>
* Support build artifacts as deploy source

Add `artifact-name` input that downloads a previously-uploaded artifact
instead of doing a sparse checkout. This enables workflows with a build
step (e.g. npm run build) to upload their output as an artifact and pass
it to the preview workflow.

https://claude.ai/code/session_01G6wVt7h6gXCLcC14yTXAkA

* Validate that artifact-name and source-dir are not both set

Fail early with a clear error if the caller specifies both inputs,
since they are mutually exclusive deploy sources.

https://claude.ai/code/session_01G6wVt7h6gXCLcC14yTXAkA

---------

Co-authored-by: Claude <noreply@anthropic.com>
GitHub doesn't render data URI images in issue/PR comments, making the
QR code feature non-functional. Remove the qrcode dependency, generation
logic, workflow input, and related tests.

https://claude.ai/code/session_01C4NTe2C83g1UxPnGvBJSHQ

Co-authored-by: Claude <noreply@anthropic.com>
The js-snippets auto-refresh module polls a version.txt file to detect
changes and trigger page reloads. This adds version.txt generation to
the deploy step so PR previews are compatible with that system.

https://claude.ai/code/session_015A4t6wPbyVGmsHbKXK22ew

Co-authored-by: Claude <noreply@anthropic.com>
Push events (e.g., main branch merges) now deploy to the root of
gh-pages while PR events continue deploying to pr-preview/pr-N.
Root deployments preserve the umbrella directory so PR previews
coexist with the main site.

- setup.ts: handle push events as deploy, auto-detect root vs PR path,
  fall back to GITHUB_SHA when PR SHA unavailable
- git-update.ts: root deployment clears everything except .git and
  umbrella dir before copying source
- preview.yml: guard commit status and comment steps for PR-only events,
  fix commit messages and concurrency key for push events

https://claude.ai/code/session_01ESQFF6dCJG9Z1o4YEeSXoE

Co-authored-by: Claude <noreply@anthropic.com>
Check GITHUB_REF against event.repository.default_branch in setup.ts
so callers don't need branch filters in their workflows.

https://claude.ai/code/session_01GsLTqC4GZ7g2MTVm6U3Nie
@PazerOP PazerOP closed this Mar 29, 2026
@PazerOP PazerOP changed the title Refactor to reusable workflow with TypeScript implementation removed Mar 29, 2026
@PazerOP PazerOP deleted the claude/fix-deploy-branch-check-nRRVE branch March 29, 2026 22:46
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