Skip to content
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

Merged
merged 219 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
959992e
feat!: wrap payloads to send to a "method" with "token" or "webhook"
zimeg Jul 18, 2024
82bbd29
docs(fix): remove an extra trailing closing brace
zimeg Aug 30, 2024
c8916a0
fix: remove milliseconds from the returned epoch time
zimeg Aug 30, 2024
efe707e
feat: log the entire error stack for easier debugs
zimeg Aug 30, 2024
c2d4e9c
build: remove compilation steps from the local build
zimeg Aug 30, 2024
1da745b
test(fix): resolve the posted webhook with placeholder values
zimeg Aug 30, 2024
09a1d45
ci: include chat.postMessage and files.uploadV2 in local tests
zimeg Aug 30, 2024
b8e82b8
ci: include static checks of code as part of ci
zimeg Aug 30, 2024
962e0db
fix: debug actual response data from the webhook
zimeg Aug 30, 2024
dbdbf9f
docs: include a few more words about action outputs
zimeg Aug 30, 2024
a10e1f7
fix: use the 'channel' in responses as 'channel_id'
zimeg Aug 30, 2024
9fb3e9e
build(fix): remove removed files from the jsdocs
zimeg Aug 30, 2024
57ab9a4
refactor: parse payload content in a new "content" module
zimeg Aug 30, 2024
6ca6013
style: remove extra spacing from the pull request template
zimeg Aug 30, 2024
5875c61
fix: remove addtional error logging from erroring inputs
zimeg Aug 30, 2024
5b4b7b8
feat: parse action payload inputs as possible yaml values
zimeg Aug 30, 2024
ee9e200
docs: update examples and wordings to use the latest changes
zimeg Aug 30, 2024
4c57022
test: update tests in ci to use the yaml inputs
zimeg Aug 30, 2024
72734a9
feat: increase methods for quick use in the local workflow
zimeg Aug 30, 2024
4fa18f2
ci(temp): use the changes of the pull request when running tests
zimeg Aug 30, 2024
32c4ddb
ci: workaround broken biome installations in ci
zimeg Aug 30, 2024
5ffcbc8
ci(fix): remove additional steps for checking test coverage
zimeg Aug 30, 2024
0d8d929
fix: avoid setting setting secrets twice for possible missing values
zimeg Aug 31, 2024
e7f7020
docs: reference the complete 'incoming webhooks' feature
zimeg Sep 25, 2024
7f42936
docs: replace the link to repo secrets with another page
zimeg Sep 25, 2024
78e74e6
feat: require a webhook type as part of webhook inputs
zimeg Sep 25, 2024
31b6ed1
feat: open the option to templatize input payloads to action input st…
zimeg Sep 25, 2024
5f3b855
feat: link the outputs of the action to log streams of the webapi
zimeg Sep 25, 2024
bc9c18b
fix: link without spacing when creating noop functions
zimeg Sep 25, 2024
8c35f78
ci(fix): use the original message timestamp when threading a message
zimeg Sep 25, 2024
b1453da
fix: use a stringified thread ts to avoid float madness
zimeg Sep 25, 2024
518946d
test: templatize the payload file inputs for variable replacements
zimeg Sep 26, 2024
1a77eed
refactor: move tests into a test directory and away from src
zimeg Sep 26, 2024
eea2eb1
fix: avoid debug logging undefined data of an undefined response
zimeg Sep 26, 2024
38b6f1e
style: lint fixes that are required for ci to pass
zimeg Sep 26, 2024
e3f0238
docs: polish and findings from past readings of the readme
zimeg Sep 26, 2024
7aee130
fix: correct webclient proxy warning to be the https axios agent
zimeg Sep 27, 2024
abda089
fix: use the nested message response to gather thread ts
zimeg Sep 27, 2024
6b14b32
test: fail tests that are expected to have thrown but dont
zimeg Sep 27, 2024
23913a6
test: confirm requests are sent with arguments to the slack web api
zimeg Sep 27, 2024
92fd8d8
fix: include the time of action completion when erroring too
zimeg Sep 27, 2024
856cb18
chore: setup a manifest app with workflow and scopes and webhooks
zimeg Sep 28, 2024
3d0eb1e
docs: improve setup instructions with more correct wordings
zimeg Sep 28, 2024
28dee88
ci: revert removal of the build step for packaged distribution
zimeg Sep 30, 2024
a9b40ba
build: include the source map in build outputs for error debugs
zimeg Sep 30, 2024
29c7ea6
ci(chore): run check ups of the health score on changes
zimeg Sep 30, 2024
1a8d212
ci(fix): include the include of included paths of check up
zimeg Sep 30, 2024
01ca583
revert(ci): oh oops the error is from codecov setups in this pr
zimeg Sep 30, 2024
b88b87a
refactor: rename the testing workflow into a single test file
zimeg Sep 30, 2024
6f23616
refactor: move the local workflow into a development area
zimeg Sep 30, 2024
815c519
style: format json with separate spacing for individual array items
zimeg Sep 30, 2024
8003d03
test: confirm changes match between develop and test and docs
zimeg Oct 1, 2024
19c1ee5
ci: fix inputs that didnt match changes made in the last commit
zimeg Oct 1, 2024
ecb8404
ci: fix the path to slack resources to be in slack paths
zimeg Oct 1, 2024
0777d30
ci: fix the gathered thread ts to be from another threaded message
zimeg Oct 1, 2024
574e5f9
test: ensure a file can be uploaded from the action too
zimeg Oct 1, 2024
a10a047
style: format the incoming webhook blocks to read inline
zimeg Oct 1, 2024
3abfdb6
style: write emojis at the start of lines for consistency
zimeg Oct 1, 2024
7c719bb
chore: merge wo conflicts in upstream main
zimeg Oct 1, 2024
7165edc
ci: react to with a method before testing incoming message
zimeg Oct 2, 2024
504fb31
fix: use the config input proxy to set the webhook proxy
zimeg Oct 2, 2024
72d552d
test: remove console logs from output when test succeeds
zimeg Oct 2, 2024
9645097
chore: merge w main and the changes to health score
zimeg Oct 2, 2024
84c034a
fix: include proxied https urls with the web client methods
zimeg Oct 2, 2024
67471c1
test: confirm retries happen at expected intervals for the client
zimeg Oct 2, 2024
c711234
test: ensure errors happen during invalid config setup
zimeg Oct 2, 2024
4c6260b
fix: templatize payload content from all input sources
zimeg Oct 3, 2024
1b4979e
test: setup the same input before each test before each test
zimeg Oct 3, 2024
48d4ccf
test: match naming of spec its for more reasoning
zimeg Oct 3, 2024
16ea7d7
test: check for replacements of templatized variables
zimeg Oct 3, 2024
05b1c7c
chore: replace hardcoding types with an upstream alternative
zimeg Oct 3, 2024
8618c4d
test: confirm the expected techniques work as expected
zimeg Oct 3, 2024
8066bf9
test: confirm errors are returned when missing webhook inputs
zimeg Oct 3, 2024
103ae85
fix: use the built distribution files when running this action
zimeg Oct 3, 2024
be37553
docs: make it clear that the unix epoch is returned in time
zimeg Oct 3, 2024
75d7165
chore: remove additional type roots from past compilation
zimeg Oct 3, 2024
bc887ca
build: include the markup-js types as a development depenency
zimeg Oct 3, 2024
90d5d06
style: remove additional undefined chaining after an initial definito…
zimeg Oct 3, 2024
12e1625
docs(fix): add a step for showing the revealed credetials
zimeg Oct 15, 2024
c3a19f3
docs: include complete example links in the ci workflow variable values
zimeg Oct 15, 2024
e909226
build: set the node version to match the runner runtime
zimeg Oct 15, 2024
a2b32d6
docs(fix): tyypo reminants -> remnants
zimeg Oct 15, 2024
6075734
docs: give the action context for the github context
zimeg Oct 15, 2024
8be2d3a
docs: locate secret values from either outputs or the app settings
zimeg Oct 17, 2024
fa91f44
docs: include the requirement of a channel ID where the bot is added
zimeg Oct 17, 2024
540f02d
docs: include an overview of the app found in resources for development
zimeg Oct 17, 2024
c21fea2
build: include an example environment variable file for testing
zimeg Oct 17, 2024
a8affaa
docs: reference the resources for testing experimental changes in dev…
zimeg Oct 17, 2024
2133481
docs(style): wrap lines that exceed the length of the deno fmt
zimeg Oct 17, 2024
fd5313b
docs: make wording of step setups more percise
zimeg Oct 17, 2024
da7d2a1
docs: revert the changed title to that of the original readme
zimeg Oct 18, 2024
7816a2c
docs(fix): replace a redirected link to contextual workflow info
zimeg Oct 18, 2024
ad5d399
temp: print the octokit context in a pull request setting
zimeg Oct 18, 2024
a7dc253
docs: fix the context of the default github event payload
zimeg Oct 21, 2024
23838b2
docs: introduce concepts of sending variables with more context
zimeg Oct 21, 2024
aab5451
docs: reword the exampliary sentance to reference 'action'
zimeg Oct 21, 2024
aceca25
docs(fix): remove the json requirement from input payloads
zimeg Oct 21, 2024
b773f12
docs(style): include a few more words for easier reading
zimeg Oct 21, 2024
e0e254b
revert "temp: print the octokit context in a pull request setting"
zimeg Oct 21, 2024
e37146c
docs: link to outbound resources with more information
zimeg Oct 22, 2024
9df54bb
docs: include more explicit detail on which workflow is updated
zimeg Oct 22, 2024
e80e77b
docs: quick link to the sections of different techniques
zimeg Oct 22, 2024
99dd6aa
docs: include information on the reason for deliminating payloads
zimeg Oct 22, 2024
ac9a37e
docs(style): change a few words for spacing setups
zimeg Oct 22, 2024
f19da83
docs(fix): recommend a templated variable found in the octokit payload
zimeg Oct 22, 2024
9bc0ad9
docs(fix): wrap a numeric float in quotations to make it a string
zimeg Oct 22, 2024
3a41460
docs: reference the complete implementation of file upload
zimeg Oct 25, 2024
0972b00
docs: express capabilities of technique without negative wording
zimeg Oct 25, 2024
619f3b3
docs: remove repeated sentance and break a paragraph into lines
zimeg Oct 25, 2024
725d89a
docs: write that the api methods used are the slack api methods
zimeg Oct 25, 2024
452188c
docs: link to the @slack/web-api landing page of tools.slack.dev
zimeg Oct 25, 2024
cedefeb
docs: redirect links to the tools subdomain of slack.dev
zimeg Oct 25, 2024
3a63569
docs: update the title of the link on creating wfb workflow with webhook
zimeg Oct 25, 2024
63a3415
docs: link to action documentation before recommending input updates
zimeg Oct 25, 2024
06555c3
docs: include information on the payload file path argument
zimeg Oct 25, 2024
a6b4974
docs: share a similar link length for method and scope docs
zimeg Oct 25, 2024
b89ded2
docs: improve the naming of example snippets
zimeg Oct 25, 2024
f1e2d31
docs(style): use a to suggest a singular slack workflow
zimeg Oct 25, 2024
5397443
docs: remove a preference for the chat.postMessage method
zimeg Oct 25, 2024
74d76d2
docs: enumerate the steps in setting up a slack api method
zimeg Oct 25, 2024
b2ba444
docs: include reference for finding app configuration tokens
zimeg Oct 25, 2024
1b38aa1
docs(fix): style the makrdown with lines that wrap
zimeg Oct 25, 2024
cd00cf2
docs: suggest a reason for selecting different inputs for http methods
zimeg Oct 25, 2024
b72c275
docs: remove a setup link from usage but detail a common edge
zimeg Oct 25, 2024
ad486c7
docs: reveal the end goal of chat.postMessage in documentation
zimeg Oct 25, 2024
229e304
docs: make it clear that parameters must be specific
zimeg Oct 26, 2024
15e3647
docs: link to the chat.postmessage method when referecing it
zimeg Oct 26, 2024
01fd198
docs: reference the block kit documentatoin in complex layouts
zimeg Oct 26, 2024
03eca40
docs: reference the chat.update method for updating messages
zimeg Oct 26, 2024
e3e3da6
docs: rewrite words to leave examples in the snippets
zimeg Oct 26, 2024
7e2302a
docs: break lines and add words for a smoother reading i hope
zimeg Oct 26, 2024
220320d
docs: make the action context source more clear
zimeg Oct 26, 2024
9f0e1f9
docs?: word this heading as an action for faster findings
zimeg Oct 26, 2024
a3e6c6e
docs: save examples of a technique for the examples section
zimeg Oct 26, 2024
a7aa1bb
docs(fix): include the token argument in the files.uploadV2 example
zimeg Oct 26, 2024
6c27de4
docs: use a standard case and size when writing words
zimeg Oct 26, 2024
d5739e8
docs: post a single message with an incoming webhook and slack app
zimeg Oct 26, 2024
7c70750
docs: add a reference to message formatting for incoming webhooks
zimeg Oct 26, 2024
ce8964f
docs: enumerate the steps in setup for technique three
zimeg Oct 26, 2024
0a258a4
docs: use the same wording in steps for creating or existing apps
zimeg Oct 26, 2024
ea1a6ca
docs: write the webpage to gather an incoming webhook as app settings
zimeg Oct 26, 2024
1360cfc
docs: write the selection of a channel as a partial step
zimeg Oct 26, 2024
982e786
docs: wrap the app settings reference page with reference words
zimeg Oct 26, 2024
c87943e
docs: write the install app as the page to install app
zimeg Oct 26, 2024
08e6a83
docs: steps 4and5and6
zimeg Oct 26, 2024
751cd02
docs: shorten one sentance and finish another
zimeg Oct 26, 2024
c023102
docs: make the workflow known as a github one in technique three
zimeg Oct 26, 2024
8b252ad
docs(fix): post a message as the name of the example here
zimeg Oct 26, 2024
cb368c9
docs: remove additoinal words that broke a line
zimeg Oct 26, 2024
a269eaf
docs: shorten the tagline in a shorter line attempt?
zimeg Oct 26, 2024
457c62e
docs: include a section on inputs for the errors option
zimeg Oct 26, 2024
3b0cbbe
docs: write notes on strategies for retrying failed requests
zimeg Oct 28, 2024
3da2f35
docs: include the added links in a commit following above
zimeg Oct 28, 2024
f365ef8
fix: reword an error to make missing technique the error part
zimeg Oct 28, 2024
30136d6
feat: set the 'ok' and 'response' output for webhook requests
zimeg Oct 28, 2024
dc37cb6
style: capitalize the word unix in action outputs
zimeg Oct 28, 2024
f18133b
test: confirm outputs match expected responses in unit
zimeg Oct 28, 2024
7b78517
fix: return the response data from a webhook request
zimeg Oct 28, 2024
f7fe23a
test: reorder the test techniques to match readme and responses
zimeg Oct 28, 2024
7d142f2
ci: setup the specific version of node used with this project
zimeg Oct 28, 2024
c97a706
ci: include the include dir in the slack health score
zimeg Oct 28, 2024
ac67ee6
docs: prefer the proxy option within option while referencing env later
zimeg Oct 28, 2024
ac915fa
docs(style): format markdown according to the deno formatter
zimeg Oct 28, 2024
cf580e6
ci(style): change incoming->method test type to avoid confusion
zimeg Oct 29, 2024
1712817
build: set the container architecture to match the github runners in …
zimeg Oct 29, 2024
adf1dc2
fix: set the webapi response if the request fails without exiting action
zimeg Oct 29, 2024
85eeec7
fix: configure webhook retries before making the request
zimeg Oct 31, 2024
713e85f
fix: retry failed webhook requests based on the response code
zimeg Oct 31, 2024
6741210
test: confirm both webhook techniques return successful outputs
zimeg Oct 31, 2024
18980a3
fix: catch failed axios responses from failed webhook requests
zimeg Oct 31, 2024
72702e7
docs: include reference to threading replies to messages
zimeg Oct 31, 2024
1c1e442
docs: share the possible expected outputs for techniques
zimeg Nov 1, 2024
d4e83d6
fix: return the channel id from methods that return it as channel.id
zimeg Nov 1, 2024
47ecafe
docs: include an example workflow that uses outputs as inputs
zimeg Nov 1, 2024
1ebcdfb
docs(style): include a joining word between dates and time
zimeg Nov 1, 2024
c0cfedb
ci: error if the api method or webhook fail to send data
zimeg Nov 1, 2024
0dd9fb1
docs(fix): use the action branch instead of a local build setup
zimeg Nov 1, 2024
53b44ca
fix: remove custom typings and depend on api results instead
zimeg Nov 1, 2024
a2f063c
docs(style): remove spacing between two steps to be more consistent
zimeg Nov 1, 2024
93bb73d
ci(fix): tag and release this action with all included files built in…
zimeg Nov 1, 2024
464750e
ci(fix): set the node version to the version saved in project
zimeg Nov 1, 2024
1ac83ed
ci: remove the excluded repo license from tagged builds for more lega…
zimeg Nov 1, 2024
cbdcd4c
chore: merge w the upstream main and fix conflicts
zimeg Nov 1, 2024
595105d
docs: guide the great documentation reader down a clear path
zimeg Nov 4, 2024
5ae8b01
docs(fix): make output attribute descriptions read in a written way
zimeg Nov 4, 2024
457c43b
docs(style): format the recent suggestions with a deno formatter
zimeg Nov 4, 2024
30943b5
docs: include a direct link to creating an app and app settings
zimeg Nov 4, 2024
10260d3
docs: remove confusing words around providing a payload to send
zimeg Nov 4, 2024
4e9cf32
docs(fix): add words to clarify to the steps that maek sense
zimeg Nov 4, 2024
7df120c
docs(style): replace 'set' w 'provide' to make developer action required
zimeg Nov 4, 2024
f1dcedb
docs: refer to packaged implementations for flattening and retries
zimeg Nov 4, 2024
cb6bb43
docs: reference related information for sometimes response arguments
zimeg Nov 4, 2024
92ec96e
docs: make the description of action io read as corrected sentances
zimeg Nov 4, 2024
500969e
docs: update the action author and description to match techniques
zimeg Nov 4, 2024
db55f1c
docs: make the input options for payloads either json or yaml
zimeg Nov 4, 2024
bb5ce26
docs: arrange the outputs according to required then alphabets
zimeg Nov 4, 2024
dae7ca0
docs: format the readme with the deno formatter again
zimeg Nov 4, 2024
5c670da
ci: use the installed linter from packages intead of actions
zimeg Nov 11, 2024
208a39c
chore(deps): bump the version of biome to the latest for ci
zimeg Nov 11, 2024
49f7227
refactor: remove chained promises while awaiting async blocks
zimeg Nov 11, 2024
12d40ae
build: configure typescript compiler options to use node 20 mappings
zimeg Nov 11, 2024
aaed7f6
chore(deps): bump @types/node to the latest version of node 20
zimeg Nov 11, 2024
b4b438f
test: assert that a test fails for the correct reason
zimeg Nov 12, 2024
a8d832c
ci: wrap timestamp values into strings to avoid float strangeness
zimeg Nov 12, 2024
cef366e
feat: raise detailed slackerrors without repeating outputs
zimeg Nov 12, 2024
9df8033
temp: break ci an an experiment in erroring outputs
zimeg Nov 12, 2024
06eb48b
temp: remove the ci step that checks prior success
zimeg Nov 12, 2024
4f678e0
revert: testing done to break ci and show error messages
zimeg Nov 12, 2024
e66be35
fix: accept lowercased retries with surrounding space
zimeg Nov 12, 2024
4826bb1
fix: return an error if an invalid retries option is uesd
zimeg Nov 12, 2024
5f00b17
test: confirm that lowercased and spaced rapid retries work
zimeg Nov 12, 2024
6a4513b
build: set the mit license in the packagelock for @actions/github
zimeg Nov 12, 2024
7d08fdb
chore(deps): bump chai and related types to the latest version
zimeg Nov 12, 2024
9032d46
chore(deps): bump the types of mocha to the latest version
zimeg Nov 12, 2024
cba3f44
chore(deps): bump the ncc packaging tool to the latest verison
zimeg Nov 12, 2024
7f34d31
chore(deps): bump typescript to the latest released version
zimeg Nov 12, 2024
3982e20
chore(deps): bump and fix changes needed for the latest flat version
zimeg Nov 12, 2024
6906f04
chore: merge w main
zimeg Nov 14, 2024
7b2b0f9
ci: revert the test runs for changes to the ci file within prs
zimeg Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .c8rc.json
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
}
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

132 changes: 0 additions & 132 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ All you need to work with this project is a supported version of [Node.js](https

### Developing

Iterate quickly by developing and testing a local version of this action using `npm run local`.
Information on setting up and configuring mocked events can be found in [`.github/workflows/local/README.md`](./workflows/local/README.md).
Iterate quickly by developing and testing all techniques of this action with a local version of this action using `npm run dev`.
Information on setting up and configuring mocked events can be found in [`.github/resources/README.md`](./resources/README.md).

### Testing

Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
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.

Expand Down
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"
}
}
7 changes: 7 additions & 0 deletions .github/resources/.env.example
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
6 changes: 6 additions & 0 deletions .github/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Application values
.env.*
.env
!.env.example
.slack/apps.json
Copy link
Member Author

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!

$ slack app link

.slack/apps.*.json
5 changes: 5 additions & 0 deletions .github/resources/.slack/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"experiments": ["bolt"],
Copy link
Member Author

Choose a reason for hiding this comment

The 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"
}

35 changes: 35 additions & 0 deletions .github/resources/.slack/incoming-webhook.json
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 }}>"
}
]
}
]
}
71 changes: 71 additions & 0 deletions .github/resources/.slack/manifest.json
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
Copy link
Member Author

Choose a reason for hiding this comment

The 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 workflows section require org_deploy_enabled: true and incoming webhooks require incoming_webhooks_enabled to be true too.

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>!"
}
}
]
}
}
}
23 changes: 23 additions & 0 deletions .github/resources/.slack/webhook-trigger.json
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}}"
}
}
}
Loading
Loading