Merge pull request #2210 from navikt/playwright-test-separat-js #2
Workflow file for this run
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
name: Visual changes bot | |
on: | |
push: | |
branches: [playwright-regresiion-test] #TODO: change to main | |
pull_request: | |
branches: [playwright-regresiion-test] #TODO: change to main | |
jobs: | |
update-screenshots: | |
name: Update screenshots | |
runs-on: ubuntu-latest-16-cores | |
permissions: | |
id-token: 'write' | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Get branch of PR | |
uses: xt0rted/pull-request-comment-branch@v3 | |
id: comment-branch | |
- name: Checkout PR branch | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.comment-branch.outputs.head_ref }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Install dependencies | |
run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- run: npm run build:storybook | |
- name: Run Playwright update screenshots | |
run: docker run --rm -v $(pwd):/workspace -w /workspace --ipc=host mcr.microsoft.com/playwright:v1.51.0-noble /bin/bash -c "CI=true npx playwright test --update-snapshots" | |
- name: Commit and push updated screenshots | |
if: always() | |
id: auto-commit-action | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: 'Update screenshots' | |
commit_user_name: Visual changes[bot] | |
- name: Handle PR Review | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
require('../../playwright/handle-review.js') |