Add a sanity check for backups

The check makes sure that the backup contains the latest PR information
(based on title).
This commit is contained in:
Faustin Lammler 2025-03-24 09:45:26 +01:00
parent 5659aa8bc8
commit 18246ed617
No known key found for this signature in database
GPG Key ID: 390A2F27832A5C79
1 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,16 @@ jobs:
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-o "archive.tgz" "$ARCHIVE_URL"
- name: Sanity check
run: |
TITLE_LATEST_PR=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" repos/$REPO/pulls --jq '.[0].title')
zgrep -a -B3 "$TITLE_LATEST_PR" archive.tgz || {
echo "Latest PR title not found in archive.tgz"
exit 1
}
- name: Save backup (restic)
run: |
export RESTIC_REPOSITORY=$RESTIC_REPOSITORY_URL/$REPO_NAME