Add workers.dev Route #2
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: Fix DNS for natalie.acreonetionos.org | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| fix-dns: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Add DNS Record | |
| env: | |
| CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| run: | | |
| set -x | |
| ZONE_ID="5b3f8237bfa2518bff375eb8163623a5" | |
| echo "=== Test auth first ===" | |
| TOKEN_TEST=$(curl -s -H "Authorization: Bearer $CF_API_TOKEN" \ | |
| "https://api.cloudflare.com/client/v4/user/tokens/verify") | |
| echo "$TOKEN_TEST" | jq . | |
| echo "=== Try to add A record for natalie ===" | |
| ADD_RESULT=$(curl -s -X POST \ | |
| "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \ | |
| -H "Authorization: Bearer $CF_API_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "type": "A", | |
| "name": "natalie", | |
| "content": "185.199.108.153", | |
| "ttl": 120, | |
| "proxied": true | |
| }' 2>&1) || true | |
| echo "Add A result: $ADD_RESULT" | |
| echo "$ADD_RESULT" | jq . || echo "Not JSON" | |
| echo "=== Done ===" |