diff --git a/README.md b/README.md index 615d272..5d4c840 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/action.yml b/action.yml index c9802d1..221824e 100644 --- a/action.yml +++ b/action.yml @@ -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' @@ -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 diff --git a/scripts/comment.sh b/scripts/comment.sh index be7b8f9..e1ef67e 100755 --- a/scripts/comment.sh +++ b/scripts/comment.sh @@ -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}