Skip to content

Ensure that the Playwright version in GitHub Actions container matches the one referenced in the CLI - #7

Merged
goldenapples merged 1 commit into
mainfrom
fix/action-version-sync
Sep 10, 2026
Merged

goldenapples merged 1 commit into
mainfrom
fix/action-version-sync

Conversation

@goldenapples

Copy link
Copy Markdown
Collaborator

Removes the hardcoded browser path in the action script, which would fail whenever the latest Chromium doesn't match the version in the Playwright container.

Also updates a number of other pieces of the plugin architecture to ensure that the version of the node script being run matches the GH Action tags, as well as the plugin version if possible.

This is slightly slower, because the CI workflow has to install the correct version of Chromium; but it is much more stable and won't break or require updating the action config every time a new version is released.

Bumps the version number to 0.4.1

A run pinned to `humanmade/wp-pattern-library@v0.2.0` failed launching
Chromium. The action ref and the code it runs were selected by two
independent mechanisms — the `version` input defaulted to `latest`, so
that pin ran CLI 0.4.0, whose Playwright resolved to 1.63.0, against a
workflow container holding 1.62.1.

Remove both seams rather than police them.

The CLI version now defaults to the ref the action was used at, read
from `github.action_ref`, so `@v0.4.1` runs CLI 0.4.1 and the pair
cannot drift. A branch or commit ref has no version to read and falls
back to `latest`, which is today's behaviour.

Chromium is then installed from that resolved tree, so it matches the
Playwright the CLI will actually load. A container image stops being a
correctness requirement and becomes what its comment always claimed:
an optimisation. The boilerplate and the docs drop it accordingly.

The remaining sync points get checks in the `versions` CI job: the
action pins in README, docs and examples must name the current release
— the manual `git grep` CONTRIBUTING asked for — and the manifest
version the plugin writes must be the one the CLI reads, which until
now surfaced only as a failed run in a consumer's repository.

Also pass `output-path` through the environment rather than
interpolating it into the script, per the reasoning already recorded
two lines above it, and bring package-lock.json's stale 0.3.0 forward.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwgCPG1eRvXtWcgGEr32fG
Comment thread docs/05-github-action.md
## Chromium

The action installs Chromium itself, matched to the Playwright version the CLI
resolves. Nothing to configure, and nothing that goes stale.

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.

Do we need to bump this in our consuming projects every time chromium updates? That feels clunky, but I'm probably misunderstanding

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, this way we just need to remove the "container" from the consuming workflow.

Previously I was using container: mcr.microsoft.com/playwright:v1.62.1-noble which came with its own versions of Playwright and Chromium. This saved a minute or so installing those dependencies on the container, but it made the version of the action tightly coupled to container specified in the workflow that calls it.

@goldenapples
goldenapples merged commit 07ff52c into main Sep 10, 2026
5 checks passed
@goldenapples
goldenapples deleted the fix/action-version-sync branch September 10, 2026 19:24
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