aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaibuzgau <mihaibuzgau@users.noreply.github.com>2020-10-29 16:56:03 +0200
committerGitHub <noreply@github.com>2020-10-29 16:56:03 +0200
commit319d2205e5e82171ccf4ce70cd484903322d36e2 (patch)
treed6a156462ad3cc6ba07e06f1dadd9b599de1cc11
parentc643dda38407ac8f208e8f191e64850e7a008200 (diff)
parent792e06928d6baaae5acc31ca4f6fe4d776dfc097 (diff)
downloadpuppet-mailalias_core-319d2205e5e82171ccf4ce70cd484903322d36e2.tar.gz
puppet-mailalias_core-319d2205e5e82171ccf4ce70cd484903322d36e2.tar.bz2
Merge pull request #29 from luchihoratiu/MODULES-10815-add-slack-notification-job
(MODULES-10815) Add Slack notification job
-rw-r--r--.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml57
1 files changed, 10 insertions, 47 deletions
diff --git a/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
index bcac27e..16d4500 100644
--- a/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
+++ b/.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
@@ -57,50 +57,13 @@ jobs:
- name: Run unit tests
run: bundle exec rake parallel_spec
- - name: Send Slack notification
- if: always()
- shell: bash
- env:
- success: '#43c78a'
- failure: '#ed5c5c'
- cancelled: '#343434'
- run: |
- curl -X POST --data-urlencode \
- "payload=\
- {\
- 'channel': '#${{ secrets.SLACK_CHANNEL }}', \
- 'attachments': \
- [\
- {\
- 'author_name': '${{ github.actor }}', \
- 'author_link': 'http://github.com/${{ github.actor }}', \
- 'author_icon': 'http://github.com/${{ github.actor }}.png?size=32', \
- 'color': '${{ env[job.status] }}', \
- 'fields': \
- [\
- {\
- 'title': 'Git reference', \
- 'value': '${{ github.ref }}', \
- 'short': true, \
- },\
- {\
- 'title': 'Event', \
- 'value': '${{ github.event_name }}', \
- 'short': true, \
- },\
- {\
- 'title': 'Workflow', \
- 'value': '<http://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>', \
- },\
- {\
- 'title': ':ci_${{ job.status}}: *${{ github.repository }}*', \
- 'value': 'The *${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}* run finished with status *${{ job.status }}*.', \
- 'short': false, \
- },\
- ],\
- 'footer': ':githublogo: Commit SHA: <http://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>', \
- },\
- ],\
- }\
- " \
- ${{ secrets.SLACK_WEBHOOK_URL }}
+ notify-via-slack:
+ name: Notify workflow conclusion via Slack
+ if: ${{ always() }}
+ needs: daily_unit_tests_with_nightly_puppet_gem
+ runs-on: 'ubuntu-latest'
+ steps:
+ - uses: luchihoratiu/notify-via-slack@main
+ with:
+ SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}