This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
generated from solvaholic/template
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.64 KB
/
octodns-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Run octodns-sync to test config
# Use this workflow to:
# - Manually test octodns config
# - Automatically test octodns config
on:
# Run when manually triggered
workflow_dispatch:
# Run on pull request open, reopen, and synchronize
pull_request_target:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test changes to DNS config
id: octodns-sync
uses: solvaholic/octodns-sync@main
with:
config_path: test-config.yaml
- name: A piece of duct tape
id: meta
run: |
_plan="$(cat ${GITHUB_WORKSPACE}/octodns-sync.plan)"
_plan="${_plan//'%'/'%25'}"
_plan="${_plan//$'\n'/'%0A'}"
_plan="${_plan//$'\r'/'%0D'}"
echo "::set-output name=plan::${_plan}"
_sha="$(echo "${{ github.event.pull_request.head.sha }}" | cut -c 1-7)"
echo "::set-output name=sha::${_sha}"
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Automatically generated by octodns-sync
- name: Add or update PR comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
## OctoDNS Plan for `${{ steps.meta.outputs.sha }}`
${{ steps.meta.outputs.plan }}
Automatically generated by octodns-sync
edit-mode: replace