Sync Hotspots #13701
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: Sync Hotspots | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
jobs: | |
cron: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync Hotspots | |
run: | | |
response=$(curl --write-out "%{http_code}" --silent --output /dev/null --request POST \ | |
--url "https://birdinghotspots.org/api/hotspot/sync?key=${{ secrets.CRON_SECRET }}") | |
if [ "$response" -eq 200 ]; then | |
echo "Request was successful (Status Code: $response)" | |
else | |
echo "Request failed with Status Code: $response" | |
exit 1 | |
fi | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Send email on failure | |
if: failure() | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: smtp-relay.brevo.com | |
server_port: 587 | |
username: [email protected] | |
password: ${{ secrets.EMAIL_PASS }} | |
subject: "GitHub Action Failed: Sync Hotspots" | |
to: [email protected] | |
from: [email protected] | |
body: | | |
The GitHub Action 'Sync Hotspots' failed. Please check the logs for more details. |