Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ name: Screenshots
#
# The caller is started by hand (workflow_dispatch) after a change to the look. A commit pushed
# with the GITHUB_TOKEN starts no other workflow, so the pictures don't run the checks again.
#
# A branch behind a ruleset (pull request, status checks) refuses the GITHUB_TOKEN; the secret
# deploy-key pushes with a deploy key on the ruleset's bypass list instead (as in bump-version.yml).
# That push starts the branch's on: push workflows. The Playwright image brings openssh-client.
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -45,6 +49,10 @@ on:
description: Name of that database
type: string
default: screenshots
secrets:
deploy-key:
description: Private SSH key of a deploy key with write access, for a branch whose ruleset lets deploy keys bypass it
required: false

permissions:
contents: read
Expand Down Expand Up @@ -87,6 +95,9 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v7
with:
# Empty: the GITHUB_TOKEN
ssh-key: ${{ secrets.deploy-key }}

# The npm package brings the binary without curl or unzip, which the image lacks
- name: Bun
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,13 @@ jobs:
| `postgres` | `""` | Postgres image, e.g. `postgres:16`, for a database next to the job; its URL is in `$POSTGRES_URL` |
| `postgres-db` | `screenshots` | name of that database |

| Secret | |
|---|---|
| `deploy-key` | private key of a deploy key with write access, for a branch behind a ruleset; set up as for [Bump version](#bump-version) (the same key can serve both) |

The command starts whatever the pictures need (a dev server, a production build with demo data, a
mock) and stops it again. Like *Bump version*, the branch must accept pushes from GitHub Actions.
mock) and stops it again. Like *Bump version*, the branch must accept pushes from GitHub Actions,
or the push needs the deploy key; that commit then runs the branch's CI.

## Versions

Expand Down
1 change: 1 addition & 0 deletions actions/commit-changes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: >-
Commits what changed under the given paths (screenshots, baselines, generated files) as
github-actions[bot] and pushes it to the branch the workflow runs on. Nothing changed: nothing
is committed. The job needs contents: write; a push with the GITHUB_TOKEN starts no other workflow.
It pushes with whatever actions/checkout set up, e.g. its ssh-key for a deploy key.

inputs:
paths:
Expand Down
Loading