-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a744206
commit c33e1f3
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Update Baselines | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_number: | ||
description: "Pull Request Number" | ||
required: true | ||
type: string | ||
branch_name: | ||
description: "Branch Name" | ||
required: true | ||
type: string | ||
|
||
env: | ||
TOKEN: ${{ secrets.GIT_ACTIONS_USER_TOKEN_CREDS }} | ||
# opts out of collecting telemetry data | ||
LOST_PIXEL_DISABLE_TELEMETRY: 1 | ||
|
||
jobs: | ||
update-baselines: | ||
if: startsWith(${{github.event.inputs.branch_name}}, 'lost-pixel-patch-') == false | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node-version: [16] | ||
pnpm-version: [6.32.13] | ||
|
||
steps: | ||
- name: Print inputs | ||
run: | | ||
echo Running on branch ${{ github.event.inputs.branch_name }} | ||
echo PR number ${{ github.event.inputs.pr_number }} | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.branch_name }} | ||
fetch-depth: 2 | ||
lfs: false | ||
|
||
- name: Install pnpm | ||
id: pnpm-install | ||
uses: pnpm/[email protected] | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
run_install: false | ||
|
||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: | | ||
.pnpm-store | ||
pnpm | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
- name: Install node @ ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install node dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: Build Storybook | ||
run: pnpm build-storybook | ||
|
||
- name: Lost Pixel | ||
id: lp | ||
uses: lost-pixel/[email protected] | ||
env: | ||
LOST_PIXEL_MODE: update | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
if: ${{ failure() && steps.lp.conclusion == 'failure' }} | ||
with: | ||
token: ${{ secrets.GIT_ACTIONS_ADMIN_TOKEN }} | ||
commit-message: "chore(baseline): update lost-pixel baselines" | ||
delete-branch: true | ||
branch: "lost-pixel-patch-${{ github.event.inputs.branch_name }}" | ||
base: ${{ github.event.inputs.branch_name }} | ||
title: "[Lost Pixel]: Automated Baseline Update - ${{ github.event.inputs.branch_name }}" | ||
body: | | ||
Original PR https://github.com/Vimeo/iris/pull/${{ github.event.inputs.pr_number }} | ||
--- | ||
<sub>Automated baseline update pull request created by [Lost Pixel](https://github.com/lost-pixel/lost-pixel)</sub> |