|
| 1 | +name: Update Playwright Snapshots |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created, edited] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: write |
| 9 | + pull-requests: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + update-snapshots: |
| 13 | + if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'update playwright snapshots') }} |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: React to the triggering comment |
| 18 | + run: | |
| 19 | + hub api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions --raw-field 'content=+1' |
| 20 | + env: |
| 21 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 22 | + |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Checkout the branch from the PR that triggered the job |
| 27 | + run: | |
| 28 | + # PR branch remote must be checked out using https URL |
| 29 | + git config --global hub.protocol https |
| 30 | + hub pr checkout ${{ github.event.issue.number }} |
| 31 | + env: |
| 32 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + |
| 34 | + - name: Install your project |
| 35 | + run: | |
| 36 | + # Execute the required installation command |
| 37 | +
|
| 38 | + - name: Update snapshots |
| 39 | + uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1 |
| 40 | + with: |
| 41 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 42 | + # Test folder within your repository |
| 43 | + test_folder: playwright-tests |
| 44 | + |
| 45 | + # Optional npm scripts (the default values are displayed) |
| 46 | + # Script to start the server or 'null' if Playwright is taking care of it |
| 47 | + # If not `null`, you must provide a `server_url` to listen to. |
| 48 | + start_server_script: start |
| 49 | + # Server url to wait for before updating the snapshots |
| 50 | + # See specification for https://github.com/iFaxity/wait-on-action `resource` |
| 51 | + server_url: http-get://localhost:8888 |
| 52 | + update_script: test:update |
0 commit comments