Check repo existance #15
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: Check repo existance | |
on: | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check all teachings | |
run: | | |
bash -c ' | |
OK=true | |
echo "Checking repos..." | |
for r in $(jq -r '.[].url' < ./teachings.json); do | |
if [ $(curl -s -o /dev/null -w "%{http_code}" https://github.com/$GITHUB_REPOSITORY_OWNER/$r) -eq 404 ]; then | |
echo "::error::$r NOT FOUND"; | |
OK=false | |
fi | |
done | |
if ! $OK; then | |
echo "::error::Some repos do not exist on github but are present on teachings.json" | |
exit 1 | |
fi | |
' |