name: DIYHRT.cafe on: workflow_dispatch: schedule: - cron: "0 0 * * 0" jobs: download: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: token: ${{ secrets.PAT_TOKEN }} - name: check for 404 run: | url="https://hrtcafe.net" status=$(curl -o /dev/null -s -w "%{http_code}" $url) if [ $status -eq 404 ]; then echo "Got 404. Exiting." curl -H "Content-Type: application/json" -d '{"content": "${{ secrets.DISCORD_USER_ID }} $URL returned 404"}' ${{ secrets.WEBHOOK_URL }} exit 1 fi - name: download .cafe if: always() run: | rm -rf diyhrt.cafe rm -rf hrtcafe.net wget -mkpKEH --limit-rate 10m --random-wait --user-agent="github.com/soapingtime/diyhrt" --domains=hrtcafe.net https://hrtcafe.net || true - name: commit changes if: ${{ success() }} uses: EndBug/add-and-commit@v9 with: add: "diyhrt.cafe" pull: "--rebase --autostash ." message: "[automated] update diyhrt.cafe" default_author: github_actions