-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: wrap payloads to send to a "method" with "token" or "webhook" #333
Changes from all commits
959992e
82bbd29
c8916a0
efe707e
c2d4e9c
1da745b
09a1d45
b8e82b8
962e0db
dbdbf9f
a10e1f7
9fb3e9e
57ab9a4
6ca6013
5875c61
5b4b7b8
ee9e200
4c57022
72734a9
4fa18f2
32c4ddb
5ffcbc8
0d8d929
e7f7020
7f42936
78e74e6
31b6ed1
5f3b855
bc9c18b
8c35f78
b1453da
518946d
1a77eed
eea2eb1
38b6f1e
e3f0238
7aee130
abda089
6b14b32
23913a6
92fd8d8
856cb18
3d0eb1e
28dee88
a9b40ba
29c7ea6
1a8d212
01ca583
b88b87a
6f23616
815c519
8003d03
19c1ee5
ecb8404
0777d30
574e5f9
a10a047
3abfdb6
7c719bb
7165edc
504fb31
72d552d
9645097
84c034a
67471c1
c711234
4c6260b
1b4979e
48d4ccf
16ea7d7
05b1c7c
8618c4d
8066bf9
103ae85
be37553
75d7165
bc887ca
90d5d06
12e1625
c3a19f3
e909226
a2b32d6
6075734
8be2d3a
fa91f44
540f02d
c21fea2
a8affaa
2133481
fd5313b
da7d2a1
7816a2c
ad5d399
a7dc253
23838b2
aab5451
aceca25
b773f12
e0e254b
e37146c
9df54bb
e80e77b
99dd6aa
ac9a37e
f19da83
9bc0ad9
3a41460
0972b00
619f3b3
725d89a
452188c
cedefeb
3a63569
63a3415
06555c3
a6b4974
b89ded2
f1e2d31
5397443
74d76d2
b2ba444
1b38aa1
cd00cf2
b72c275
ad486c7
229e304
15e3647
01fd198
03eca40
e3e3da6
7e2302a
220320d
9f0e1f9
a3e6c6e
a7aa1bb
6c27de4
d5739e8
7c70750
ce8964f
0a258a4
ea1a6ca
1360cfc
982e786
c87943e
08e6a83
751cd02
c023102
8b252ad
cb368c9
a269eaf
457c62e
3b0cbbe
3da2f35
f365ef8
30136d6
dc37cb6
f18133b
7b78517
f7fe23a
7d142f2
c97a706
ac67ee6
ac915fa
cf580e6
1712817
adf1dc2
85eeec7
713e85f
6741210
18980a3
72702e7
1c1e442
d4e83d6
47ecafe
1ebcdfb
c0cfedb
0dd9fb1
53b44ca
a2f063c
93bb73d
464750e
1ac83ed
cbdcd4c
595105d
5ae8b01
457c43b
30943b5
10260d3
4e9cf32
7df120c
f1dcedb
cb6bb43
92ec96e
500969e
db55f1c
bb5ce26
dae7ca0
5c670da
208a39c
49f7227
12d40ae
aaed7f6
b4b438f
a8d832c
cef366e
9df8033
06eb48b
4f678e0
e66be35
4826bb1
5f00b17
6a4513b
7d08fdb
9032d46
cba3f44
7f34d31
3982e20
6906f04
7b2b0f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"include": ["src/*.js"], | ||
"exclude": ["**/*.spec.js"], | ||
"reporter": ["lcov", "text"], | ||
"all": false, | ||
"cache": true | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### Summary | ||
### Summary | ||
|
||
Describe the goal of this PR. Mention any related Issue numbers. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{ | ||
"pull_request": { | ||
"user": { | ||
"login": "dependabot" | ||
}, | ||
"title": "Bump actions/checkout from 3 to 4", | ||
"html_url": "https://github.com/slackapi/slack-github-action/pull/238" | ||
}, | ||
"repository": { | ||
"full_name": "slackapi/slack-github-action" | ||
}, | ||
"sender": { | ||
"login": "dependabot" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Move this file to .env before starting | ||
|
||
# https://api.slack.com/apps/A0123456789 | ||
export SLACK_BOT_TOKEN=xoxb-01010101-example | ||
export SLACK_CHANNEL_ID=C0123456789 | ||
export SLACK_INCOMING_WEBHOOK=https://hooks.slack.com/services/T0123456789/B0123456789/abcdefghijklmnopqrstuvwxyz | ||
export SLACK_WEBHOOK_TRIGGER=https://hooks.slack.com/triggers/T0123456789/00000000000/abcdefghijklmnopqrstuvwxyz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Application values | ||
.env.* | ||
.env | ||
!.env.example | ||
.slack/apps.json | ||
.slack/apps.*.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"experiments": ["bolt"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part of the PR might be worth separate discussion, although I find it so useful to include here as a part of testing. IMO it's alright to be using experimental features (perhaps helpful for finding edges of experiments) but I realize too that this might be opinionated β‘ |
||
"project_id": "c4805b41-d1ce-4ea0-b297-ed2f8c64c267" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"text": ":email: A GitHub Action `${{ github.eventName }}` event status is ${{ env.JOB_STATUS }}", | ||
"attachments": [ | ||
{ | ||
"color": "${{ env.ATTACHMENT_COLOR }}", | ||
"fields": [ | ||
{ | ||
"title": "Repository", | ||
"short": false, | ||
"value": "<${{ github.payload.repository.html_url }}|${{ github.payload.repository.full_name }}>" | ||
}, | ||
{ | ||
"title": "Ref", | ||
"short": false, | ||
"value": "${{ github.ref }}" | ||
}, | ||
{ | ||
"title": "Commit", | ||
"short": false, | ||
"value": "<${{ github.payload.repository.html_url }}/commit/${{ github.sha }}|${{ github.sha }}>" | ||
}, | ||
{ | ||
"title": "Author", | ||
"short": false, | ||
"value": "<https://github.com/${{ github.actor }}|${{ github.actor }}>" | ||
}, | ||
{ | ||
"title": "Workflow", | ||
"short": false, | ||
"value": "<${{ github.payload.repository.html_url }}/actions/runs/${{ github.runId }}|${{ github.workflow }}>" | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"_metadata": { | ||
"major_version": 2 | ||
}, | ||
"display_information": { | ||
"name": "slacktion", | ||
"description": "an application for developing the Slack GitHub Action" | ||
}, | ||
"features": { | ||
"app_home": { | ||
"messages_tab_enabled": true, | ||
"messages_tab_read_only_enabled": true | ||
}, | ||
"bot_user": { | ||
"display_name": "slacktion" | ||
} | ||
}, | ||
"oauth_config": { | ||
"scopes": { | ||
"bot": [ | ||
"chat:write", | ||
"chat:write.public", | ||
"files:write", | ||
"incoming-webhook", | ||
"reactions:write" | ||
] | ||
} | ||
}, | ||
"settings": { | ||
"org_deploy_enabled": true, | ||
"incoming_webhooks": { | ||
"incoming_webhooks_enabled": true | ||
} | ||
}, | ||
Comment on lines
+29
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This combination is so interesting to me, but also required for this app. The Tagging the wise @WilliamBergamin here for awareness! Both features work well when this is installed to a standalone workspace, but IIRC something strange might happen elsewhere π |
||
"workflows": { | ||
"event_notifications": { | ||
"title": "GitHub event notifications", | ||
"description": "A new changeset has been discovered", | ||
"input_parameters": { | ||
"properties": { | ||
"author": { | ||
"type": "string" | ||
}, | ||
"channel_id": { | ||
"type": "slack#/types/channel_id" | ||
}, | ||
"repo_name": { | ||
"type": "string" | ||
}, | ||
"status": { | ||
"type": "string" | ||
}, | ||
"event_url": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["author", "channel_id", "repo_name", "status", "event_url"] | ||
}, | ||
"steps": [ | ||
{ | ||
"id": "0", | ||
"function_id": "slack#/functions/send_message", | ||
"inputs": { | ||
"channel_id": "{{inputs.channel_id}}", | ||
"message": ":ship: {{inputs.repo_name}}(@{{inputs.author}}): `{{inputs.status}}` <{{inputs.event_url}}|Check it out here>!" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "webhook", | ||
"name": "Post the latest actions from GitHub", | ||
"description": "Share event information to a channel", | ||
"workflow": "#/workflows/event_notifications", | ||
"inputs": { | ||
"author": { | ||
"value": "{{data.author}}" | ||
}, | ||
"channel_id": { | ||
"value": "{{data.channel_id}}" | ||
}, | ||
"repo_name": { | ||
"value": "{{data.repo_name}}" | ||
}, | ||
"status": { | ||
"value": "{{data.status}}" | ||
}, | ||
"event_url": { | ||
"value": "{{data.event_url}}" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This goes against current recommendations, but I'm struggling to commit these values here π³
I'm instead super interested in exploring ways to share app IDs between collaborators without using this file. Right now that's not so quick, but we do have a command to help for the app ID we do know!