-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add workflow to update snapshots from PR comment (#406)
Signed-off-by: Keith Zantow <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
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 |