Skip to content

Update Lost Pixel Baseline #7

Update Lost Pixel Baseline

Update Lost Pixel Baseline #7

name: Update Lost Pixel Baseline
# Run this workflow to update the Lost Pixel baseline on a PR.
on: workflow_dispatch
jobs:
lost-pixel-update:
runs-on: ubuntu-latest
# Only run this job on branches other than master; this is to prevent the Lost Pixel baseline from being updated on the master branch.
# The baseline should only be updated on PRs, not on the master branch.
if: ${{ github.ref != 'refs/heads/master' }}
steps:
- name: Checkout validator site
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install
run: npm install
- name: Test
run: npm test
- name: Start server (in background)
run: npm run start &
- name: Create .lostpixel directory if it doesn't exist
# This is a workaround for https://github.com/lost-pixel/lost-pixel/issues/344
run: mkdir -p .lostpixel/baseline
- name: Lost Pixel
id: lp
uses: lost-pixel/lost-pixel@v3.16.0
env:
LOST_PIXEL_MODE: update
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
if: ${{ failure() && steps.lp.conclusion == 'failure' }}
with:
path: ./
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
commit-message: Update lost-pixel baselines
committer: openactive-bot <openactive-bot@users.noreply.github.com>
author: openactive-bot <openactive-bot@users.noreply.github.com>
signoff: false
branch: 'lost-pixel-update/${{ github.ref_name }}'
delete-branch: true
title: 'Lost Pixel update - ${{ github.ref_name }}'
body: |
Automated baseline update PR created by Lost Pixel
Please check the updated baseline images are as expected before merging this PR.
labels: |
automated pr
draft: false
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"