Monitor for spec changes #71
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: Monitor for spec changes | |
on: | |
schedule: | |
- cron: '42 6 */2 * *' | |
jobs: | |
spec: | |
name: Verify spec | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download spec | |
run: | | |
curl https://stream.wikimedia.org/?spec > /tmp/spec.json | |
- name: Upload spec | |
uses: actions/upload-artifact@v3 | |
with: | |
name: spec | |
path: /tmp/spec.json | |
- name: Verify spec | |
run: | | |
EXPECT="$( cat spec.json | sha1sum )" | |
ACTUAL="$( cat /tmp/spec.json | sha1sum )" | |
echo "Expected: $EXPECT" | |
echo "Actual: $ACTUAL" | |
if [[ "$EXPECT" != "$ACTUAL" ]]; then | |
echo "Spec has changed. Please update the code." | |
echo "Update with \`curl https://stream.wikimedia.org/?spec > spec.json\`" | |
exit 1 | |
fi |