Skip to content

Configure DMARC for Mailgun #22

Configure DMARC for Mailgun

Configure DMARC for Mailgun #22

Workflow file for this run

name: Preview
on:
pull_request_target:
types: [opened, reopened, synchronize]
jobs:
build:
name: Preview
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# SECURITY: We are checking out dnsconfig.js and creds.json from the PR.
# These two files cannot perform I/O, and cannot thus be used to leak
# the secret tokens. As a second layer of security, for this job we use
# a Cloudflare API token with read-only permissions.
- name: Checkout config from PR
run: |
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/head
git checkout FETCH_HEAD -- dnsconfig.js
- name: Generate preview
id: preview
run: |
{
echo "dnscontrol<<DNS_CONTROL_PREVIEW_OUTPUT"
docker run --rm -v "$(pwd):/dns" --env CLOUDFLARE_ACCOUNT_ID --env CLOUDFLARE_API_TOKEN ghcr.io/stackexchange/dnscontrol:4.18.0 preview | sed -e 's/\x1b\[[0-9;]*m//g'
echo "DNS_CONTROL_PREVIEW_OUTPUT"
} | tee -a $GITHUB_OUTPUT
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN_READ_ONLY }}
- name: Create comment
uses: babel/actions/create-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue: ${{ github.event.pull_request.number }}
comment: |
Preview output:
```
${{ steps.preview.outputs.dnscontrol }}
```