Skip to content

Commit

Permalink
chore: add workflow to update snapshots from PR comment (#406)
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Zantow <[email protected]>
  • Loading branch information
kzantow authored Apr 3, 2023
1 parent c6a64da commit c82ee26
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update snapshots
on:
issue_comment:
types: [created]
jobs:
update-snapshots:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/update-snapshots') }}
steps:
- name: Generate token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.TOKEN_APP_ID }}
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Update snapshots
run: |
# install husky hooks and dependencies:
npm install
# update snapshots
npm run test:update-snapshots
- name: Commit snapshots
run: |
git config --global user.name 'anchore-actions'
git config --global user.email '[email protected]'
git commit -s -am "chore(test): update snapshots"
git push

0 comments on commit c82ee26

Please sign in to comment.