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