Vigiar
1
0
Derivar
Você já tinha feito uma derivação do repositório dns-update-action, anteriormente
0
dns-update-action/action.yml
2026-11-28 15:28:04 +02:00

84 linhas
3 KiB
YAML

name: "Interweb Mozambique DNS update"
description: "Create, update or delete DNS records of your Interweb Mozambique domain through the API."
author: "Interweb Mozambique"
branding:
icon: "globe"
color: "blue"
inputs:
api-key:
description: "Your Interweb Mozambique API key, with dns:read and dns:write. Keep it in a secret. If empty, the INTERWEB_API_KEY environment variable is used."
required: false
default: ""
domain:
description: "The domain whose zone you change, for example example.co.mz."
required: true
action:
description: "upsert (create or change, the default), create (always add) or delete."
required: false
default: "upsert"
type:
description: "Record type: A, AAAA, CNAME, MX, TXT, NS, SRV or CAA."
required: false
default: ""
name:
description: "Record name, such as www. Use @ for the domain itself."
required: false
default: "@"
value:
description: "Record value. Required to create or change. To delete, it limits the delete to records with this value."
required: false
default: ""
ttl:
description: "TTL in seconds, from 60 to 604800. Empty keeps the current one, or 14400 on a new record."
required: false
default: ""
priority:
description: "Priority for MX and SRV, or the flag on CAA."
required: false
default: ""
match-value:
description: "On upsert, the current value of the record to change, when there are several with the same name and type."
required: false
default: ""
records:
description: "Several records at once, as a JSON list of objects with action, type, name, value, ttl, priority and match_value. When set, the single-record inputs are ignored."
required: false
default: ""
dry-run:
description: "true shows what would change without changing anything."
required: false
default: "false"
outputs:
changed:
description: "true when at least one record was created, changed or deleted."
value: ${{ steps.dns.outputs.changed }}
record-ids:
description: "The ids of the records touched, separated by commas."
value: ${{ steps.dns.outputs.record-ids }}
simulated:
description: "true when the API only simulated the change (Sandbox key)."
value: ${{ steps.dns.outputs.simulated }}
runs:
using: "composite"
steps:
- id: dns
shell: bash
env:
INPUT_API_KEY: ${{ inputs.api-key }}
INPUT_DOMAIN: ${{ inputs.domain }}
INPUT_ACTION: ${{ inputs.action }}
INPUT_TYPE: ${{ inputs.type }}
INPUT_NAME: ${{ inputs.name }}
INPUT_VALUE: ${{ inputs.value }}
INPUT_TTL: ${{ inputs.ttl }}
INPUT_PRIORITY: ${{ inputs.priority }}
INPUT_MATCH_VALUE: ${{ inputs.match-value }}
INPUT_RECORDS: ${{ inputs.records }}
INPUT_DRY_RUN: ${{ inputs.dry-run }}
run: |
PY="$(command -v python3 || command -v python)"
if [ -z "$PY" ]; then echo "::error::Python 3 is needed on the runner."; exit 1; fi
"$PY" "$GITHUB_ACTION_PATH/dns_update.py"