Skip to content

Commit

Permalink
chore: add bot command /snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneDot committed Oct 7, 2023
1 parent b826400 commit 3a063d3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
issue_comment:
types: [created, edited]

name: Bot

jobs:
pr_snapshot_commented:
# This job only runs for pull request comments
name: PR snapshot comment
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/snapshot' }}
strategy:
# Do not run in parallel because we may create a new commit
max-parallel: 1
matrix:
name: [windows, linux]
include:
- name: windows
os: windows-latest
- name: linux
os: ubuntu-latest
runs-on: ${{ matrix.os }}
env:
# Set TRYCMD=overwrite to update snapshot
TRYCMD: overwrite
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
# Pinned to the commit hash of v2.2.1
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
shared-key: pr-snapshot-commented-${{ matrix.name }}
- uses: actions-rs/cargo@v1
# Generate new snapshots
with:
command: test
args: cli_tests
- run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "test: update snapshot for ${{ matrix.name }}"
git push

0 comments on commit 3a063d3

Please sign in to comment.