Skip to content

Commit

Permalink
Set up a nightly automatic snapshot refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybosamiya committed Mar 7, 2024
1 parent 7f23932 commit 86a60e0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/nightly-snapshot-refresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: SnapshotRefresh

on:
# Run either manually upon being dispatched by user
workflow_dispatch:
# Or on schedule, once every night
schedule:
- cron: '0 0 * * *' # Run every night at midnight UTC

jobs:
check-and-refresh-snapshot:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- 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

0 comments on commit 86a60e0

Please sign in to comment.