Skip to content

Commit

Permalink
feat(rundeck-notify): notification is more explicit
Browse files Browse the repository at this point in the history
DEVOPS-138
  • Loading branch information
remdub committed Jul 26, 2024
1 parent 24fc7d2 commit 6b59ab3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## [unreleased] - xxxx-xx-xx
## Changed
- rundeck-notify
- notification message now includes a link to rundeck job
- notification message is more explicit and includes a hyperlink to the rundeck job


## [v3.4] - 2024-07-25
Expand Down
4 changes: 2 additions & 2 deletions rundeck-notify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ runs:
if: ${{ inputs.MATTERMOST_WEBHOOK_URL != '' }}
run: |
JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
MESSAGE="rundeck job [${{ steps.call-rundeck-job.outputs.JOB_NAME }}](${{ steps.call-rundeck-job.outputs.JOB_EXECUTION_PERMALINK }}) has been successfully called . [Click here to see job on GitHub]($JOB_URL) "
MESSAGE="Rundeck job [${{ steps.call-rundeck-job.outputs.JOB_NAME }}](${{ steps.call-rundeck-job.outputs.JOB_EXECUTION_PERMALINK }}) has been successfully executed by [GitHub workflow $GITHUB_WORKFLOW]($JOB_URL) on repository [$GITHUB_REPOSITORY]"
curl -i -X POST -H 'Content-Type: application/json' -d "{\"text\": \"$MESSAGE\"}" ${{ inputs.MATTERMOST_WEBHOOK_URL }}
shell: bash
- name : Send failure notification on Mattermost
if: ${{ failure() && inputs.MATTERMOST_WEBHOOK_URL != '' }}
run: |
JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
MESSAGE="Error : cannot call rundeck job [${{ steps.call-rundeck-job.outputs.JOB_NAME }}](${{ steps.call-rundeck-job.outputs.JOB_EXECUTION_PERMALINK }}). [Click here to see job on GitHub]($JOB_URL)"
MESSAGE="Error : there was an error in executation of Rundeck job [${{ steps.call-rundeck-job.outputs.JOB_NAME }}](${{ steps.call-rundeck-job.outputs.JOB_EXECUTION_PERMALINK }})by [GitHub workflow $GITHUB_WORKFLOW]($JOB_URL) on repository [$GITHUB_REPOSITORY]"
curl -i -X POST -H 'Content-Type: application/json' -d "{\"text\": \"$MESSAGE\"}" ${{ inputs.MATTERMOST_WEBHOOK_URL }}
shell: bash

0 comments on commit 6b59ab3

Please sign in to comment.