Skip to content

v1.6.5

v1.6.5 #205

name: Update Snapshots
on: pull_request
jobs:
update_snapshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: ./tests/scripts/start-storybook.sh
env:
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }}
- run: npm run update-snapshots
- name: Push changes
id: push-changes
uses: EndBug/add-and-commit@v9
with:
message: "Update snapshots"
add: ".storybook/snapshots/__snapshots__"
push: true
pull: --rebase --autostash
default_author: github_actions
- name: Fail job if push changes
if: steps.push-changes.outputs.pushed == 'true'
uses: actions/github-script@v7
with:
script: |
core.setFailed('Snapshot updates were made. A new commit with new snapshots was pushed.')