SnapshotRefresh #24
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
name: SnapshotRefresh | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
# Run either manually upon being dispatched by user | |
workflow_dispatch: | |
# Or on schedule | |
schedule: | |
- cron: '0 0 1 * *' # Runs at 00:00, on day 1 of each month | |
jobs: | |
check-and-refresh-snapshot: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Make sure to have the latest released verusfmt on the PATH | |
run: | | |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/verus-lang/verusfmt/releases/latest/download/verusfmt-installer.sh | sh | |
- name: Run script and check for changes | |
id: nightly-check | |
run: | | |
cd examples/verus-snapshot | |
./get_latest.sh | |
if git diff --exit-code; then | |
echo "No changes" | |
echo "changes=false" >> $GITHUB_OUTPUT | |
else | |
echo "Changes found" | |
echo "changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Pull Request | |
if: ${{ steps.nightly-check.outputs.changes == 'true' }} | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: "chore: update to latest Verus snapshot" | |
branch: verus-snapshot-update | |
delete-branch: true | |
title: "Verus snapshot update" | |
body: "Automated verus snapshot update by GitHub Actions." | |
base: main |