Skip to content

Commit

Permalink
feature: Use custom header
Browse files Browse the repository at this point in the history
  • Loading branch information
yoz committed Dec 23, 2024
1 parent 4031e5e commit a21bfad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Run octodns-sync in force mode? Set "Yes" to do it.

Default `"No"`.

### `header`

Provide a custom header in pr comment.

Default `"## octoDNS Plan for sha commit"`.

### `add_pr_comment`

Add plan as a comment, when triggered by a pull request? Set "Yes" to do it.
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
description: 'Run octodns-sync in force mode?'
required: false
default: 'No'
header:
description: 'Provide a custom header to use in pr comment'
required: true
default: '## octoDNS Plan for ${{ github.sha }}'
zones:
description: 'Space separated list of zones to sync, leave empty to sync
all zones in the config file'
Expand Down Expand Up @@ -55,6 +59,7 @@ runs:
id: comment
env:
ADD_PR_COMMENT: ${{ inputs.add_pr_comment }}
HEADER: ${{ inputs.header }}
PR_COMMENT_TOKEN: ${{ inputs.pr_comment_token }}
COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
run: ${{ github.action_path }}/scripts/comment.sh
Expand Down
3 changes: 1 addition & 2 deletions scripts/comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ if [ -z "${COMMENTS_URL}" ]; then
fi

# Construct the comment body
_sha="$(git log -1 --format='%h')"
_header="## octoDNS Plan for ${_sha}"
_header="${HEADER}"
_footer="Automatically generated by octodns-sync"
_body="${_header}
Expand Down

0 comments on commit a21bfad

Please sign in to comment.