Skip to content

Commit 7a55be6

Browse files
authored
feat: add slack integration to post deployment completion messages (#6)
* feat: add slack integration to post deployment completion messages * chore: bump action tag to test * fix: properly format urls * fix: review comments
1 parent dc6e884 commit 7a55be6

File tree

11 files changed

+22901
-8563
lines changed

11 files changed

+22901
-8563
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ jobs:
1111
- uses: actions/checkout@v1
1212

1313
- name: create a deployment
14-
uses: npm/action-deploy@v2
14+
uses: npm/action-deploy@v2.1.0
1515
id: create-deployment
1616
with:
1717
type: create
1818
token: ${{github.token}}
1919
logs: https://github.com/npm/action-deploy/actions?query=workflow%3Adeploy
2020
environment_url: https://npmjs.com
2121
job_status: ${{job.status}}
22+
slack_token: ${{secrets.NPM_ROBOT_SLACK_TOKEN}}
23+
slack_channel: npm-ops
2224

2325
# add here an actual deployment
2426
- name: placeholder for actual deployment

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Inputs:
2020
`environment_url`|link to the deployed application
2121
`description`|optional description, defaults to `"deployed by $context.actor"`
2222
`job_status`|pass `${{job.status}}` to set the deployment completion status post script accordingly
23+
`slack_token`|optional token of slack integration to post messages with deployment results
24+
`slack_channel`|optional slack channel name (both `slack_token` and `slack_channel` are required to post a message)
2325

2426
Outputs:
2527

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ inputs:
3232
job_status:
3333
required: false
3434
description: pass `{{job.status}}` to set the deployment completion status post script accordingly
35+
slack_token:
36+
required: false
37+
description: pass to authorize deployment completion messages to Slack
38+
slack_channel:
39+
required: false
40+
description: name of channel to post deployment completion messages
3541
runs:
3642
using: 'node12'
3743
main: 'dist/main/index.js'

0 commit comments

Comments
 (0)