Skip to content

Commit 3f1839e

Browse files
authored
Merge pull request #115 from NHSDigital/feature/eja-add-slack-webhook
eja - experimenting with slack webhook
2 parents c803d54 + 78cb5e3 commit 3f1839e

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

.github/workflows/cicd-2-publish.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,14 @@ jobs:
136136
# asset_path: ./build/lambda.zip
137137
# asset_name: lambda-${{ needs.metadata.outputs.version }}.zip
138138
# asset_content_type: application/zip
139-
success:
140-
name: "Success notification"
141-
runs-on: ubuntu-latest
142-
needs: [publish]
143-
steps:
144-
- name: "Check prerequisites for notification"
145-
id: check
146-
run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT
147-
- name: "Notify on publishing packages"
148-
if: steps.check.outputs.secret_exist == 'true'
149-
uses: nhs-england-tools/[email protected]
139+
- name: "Notify Slack on PR merge"
140+
uses: slackapi/[email protected]
150141
with:
151-
github-token: ${{ secrets.GITHUB_TOKEN }}
152-
teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }}
153-
message-title: "Notification title"
154-
message-text: "This is a notification body"
155-
link: ${{ github.event.pull_request.html_url }}
142+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
143+
webhook-type: webhook-trigger
144+
payload: |
145+
status: "${{ job.status }}"
146+
link: "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
147+
Author: "${{ github.actor }}"
148+
title: "Pushed to main"
149+
version: "${{ needs.metadata.outputs.version }}"

0 commit comments

Comments
 (0)