Skip to content

Support 'use original image' for header images #11

Support 'use original image' for header images

Support 'use original image' for header images #11

name: Update Snapshots on Comment
on:
workflow_dispatch:
issue_comment:
types: [created]
env:
AUNTY_HOST: localhost # This tells aunty to serve on localhost
TERMINUS_FETCH_API_KEY: ${{ secrets.TERMINUS_FETCH_API_KEY }}
jobs:
update-snapshots:
name: Update Snapshots
if: github.event.issue.pull_request && contains(github.event.comment.body, '/approve-snapshots')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Get branch of PR
uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Comment action started
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Updating snapshots. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status.
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Setup terminus API key
run: echo "TERMINUS_FETCH_API_KEY=$TERMINUS_FETCH_API_KEY" > .env
- name: Run Playwright and update snapshots
run: npx playwright test --update-snapshots
- name: Commit and push updated snapshots
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update e2e snapshots'
- name: Comment success
uses: thollander/actions-comment-pull-request@v3
with:
message: |
📸 Successfully updated and committed Playwright snapshots!