Mirror to Disroot #47
This file contains hidden or 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: Mirror to Disroot | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 1,15 * *" | |
jobs: | |
disroot: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: check for 404 | |
run: | | |
url="https://git.disroot.org/diyhrt/mirrors" | |
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 | |
- uses: pixta-dev/[email protected] | |
with: | |
target_repo_url: "[email protected]:diyhrt/mirrors.git" | |
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} |