Skip to content

build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend #4301

build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend

build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /frontend #4301

name: Update HTML Snapshot when comment on pr
on:
issue_comment:
types: [created]
jobs:
update-snapshot:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: listen for PR Comments
uses: machine-learning-apps/actions-chatops@master
with:
TRIGGER_PHRASE: "/update-html-snapshot"
env: # you must supply GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: prcomm
# This step clones the branch of the PR associated with the triggering phrase, but only if it is triggered.
- name: clone branch of PR
if: steps.prcomm.outputs.BOOL_TRIGGERED == 'true'
uses: actions/checkout@master
with:
ref: ${{ steps.prcomm.outputs.BRANCH_NAME }}
- name: Show current running workflows' id
if: steps.prcomm.outputs.BOOL_TRIGGERED == 'true'
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Update HTML Snapshot Triggered!
Address: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Try update snapshot
if: steps.prcomm.outputs.BOOL_TRIGGERED == 'true'
run: |
cd e2e
echo ::group::build
make server compose-args="--detach"
make wait-server
echo ::endgroup::build
make update-html-snapshot
make test-html-ci # ensure test pass after update
- name: Commit result
if: steps.prcomm.outputs.BOOL_TRIGGERED == 'true'
run: |
git pull
git config --global user.name ${{ github.event.comment.user.login }}
git config --global user.email ${{ github.event.comment.user.login }}@github.fake
git add .
git commit -am 'test(e2e): update html snapshot'
- name: Push changes
if: steps.prcomm.outputs.BOOL_TRIGGERED == 'true'
uses: ad-m/github-push-action@master
with:
# use my own token instead of GITHUB_TOKEN to trigger future workflows
github_token: ${{ secrets.WORKFLOW_TOKEN }}
branch: ${{ steps.prcomm.outputs.BRANCH_NAME }}