-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (41 loc) · 1.35 KB
/
snapshot-refresh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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' # Run every Monday night at midnight UTC
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