Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 14 additions & 15 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ After a major version increment, there also may be maintenance branches created

Labels are used to run issues through an organized workflow. Here are the basic definitions:

* `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been
documented and the issue has been reproduced.
* `enhancement`: A feature request for something this package might not already do.
* `docs`: An issue that is purely about documentation work.
* `tests`: An issue that is purely about testing work.
* `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information.
* `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in this issues.
* `question`: An issue that is like a support request because the user's usage was not correct.
* `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number.
* `security`: An issue that has special consideration for security reasons.
* `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known.
* `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number.
- `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been documented and the issue has been reproduced.
- `enhancement`: A feature request for something this package might not already do.
- `docs`: An issue that is purely about documentation work.
- `tests`: An issue that is purely about testing work.
- `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information.
- `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in this issues.
- `question`: An issue that is like a support request because the user's usage was not correct.
- `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number.
- `security`: An issue that has special consideration for security reasons.
- `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known.
- `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number.

**Triage** is the process of taking new issues that aren't yet "seen" and marking them with a basic
level of information with labels. An issue should have **one** of the following labels applied:
Expand All @@ -114,10 +113,10 @@ relevant once again, reopening is great and better than creating a duplicate iss

This repo contains two types of docs files:

* markdown files
* sidebar.json
- markdown files
- sidebar.json

The private repo containing the tools.slack.dev site pulls these in at build time.
The private repo containing the docs.slack.dev site pulls these in at build time.

Maintainers need to use the `run workflow` button associated with the `deploy` workflow in that private repo to update the docs with changes from here.

Expand Down
4 changes: 2 additions & 2 deletions .github/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ of the `.github/resources/.actions/event.json` file.

Reference: https://docs.github.com/en/webhooks/webhook-events-and-payloads

[cli]: https://api.slack.com/automation/cli/commands
[cli]: https://docs.slack.dev/tools/slack-cli/
[develop]: ../workflows/develop.yml
[manifest]: https://api.slack.com/concepts/manifests
[manifest]: https://docs.slack.dev/app-manifests/
[secrets]: https://github.com/slackapi/slack-github-action/settings/secrets/actions
[slacktion]: ./.slack/manifest.json
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

[![codecov](https://codecov.io/gh/slackapi/slack-github-action/graph/badge.svg?token=OZNX7FHN78)](https://codecov.io/gh/slackapi/slack-github-action)

Comprehensive documentation is available at [tools.slack.dev/slack-github-action](https://tools.slack.dev/slack-github-action).
Comprehensive documentation is available at [docs.slack.dev/tools/slack-github-action](https://docs.slack.dev/tools/slack-github-action).

Use this GitHub Action to:

- [Send data with a webhook to start a workflow in Workflow Builder](https://tools.slack.dev/slack-github-action/sending-techniques/sending-data-webhook-slack-workflow).
- [Send data using a Slack API method and a secret token with required scopes](https://tools.slack.dev/slack-github-action/sending-techniques/sending-data-slack-api-method/).
- [Send data as a message with a Slack incoming webhook URL](https://tools.slack.dev/slack-github-action/sending-techniques/sending-data-slack-incoming-webhook/).
- [Send data with a webhook to start a workflow in Workflow Builder](https://docs.slack.dev/tools/slack-github-action/sending-techniques/sending-data-webhook-slack-workflow).
- [Send data using a Slack API method and a secret token with required scopes](https://docs.slack.dev/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/).
- [Send data as a message with a Slack incoming webhook URL](https://docs.slack.dev/tools/slack-github-action/sending-techniques/sending-data-slack-incoming-webhook/).

## Project details

Expand Down
6 changes: 3 additions & 3 deletions docs/additional-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The `proxy` option can also be provided with the `HTTPS_PROXY` or `https_proxy`

## Retrying failed requests

Sometimes outgoing requests fail due to [rate limits](https://docs.slack.dev/apis/web-api/rate-limits) or similar [HTTP responses](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) and can be retried later.
Sometimes outgoing requests fail due to [rate limits](/apis/web-api/rate-limits) or similar [HTTP responses](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) and can be retried later.

The `retries` option can be configured to the needs of your workflow with one of these values:

Expand All @@ -95,11 +95,11 @@ The `retries` option can be configured to the needs of your workflow with one of
text: "status: all things are going good"
```

Behind the scenes, [automatic retries](https://tools.slack.dev/node-slack-sdk/web-api/#automatic-retries) are handled with the [`@slack/web-api`](https://tools.slack.dev/node-slack-sdk/web-api) package for Slack API methods, and [`axios-retry`](https://www.npmjs.com/package/axios-retry) when sending with a webhook.
Behind the scenes, [automatic retries](/tools/node-slack-sdk/web-api/#automatic-retries) are handled with the [`@slack/web-api`](/tools/node-slack-sdk/web-api/) package for Slack API methods, and [`axios-retry`](https://www.npmjs.com/package/axios-retry) when sending with a webhook.

## Sending to a custom API URL

In certain circumstances, such as testing the sent payload, a [custom API URL](https://tools.slack.dev/node-slack-sdk/web-api/#custom-api-url) can be used to change where `method` requests are sent:
In certain circumstances, such as testing the sent payload, a [custom API URL](/tools/node-slack-sdk/web-api/#custom-api-url) can be used to change where `method` requests are sent:

```yaml
- name: Send to a custom API URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ sidebar_label: Overview

# Sending data using a Slack API method

A bot token or user token or [token of some other kind](https://docs.slack.dev/authentication/tokens) must be used to call one of [the Slack API methods](https://docs.slack.dev/reference/methods) with this technique.
A bot token or user token or [token of some other kind](/authentication/tokens) must be used to call one of [the Slack API methods](/reference/methods) with this technique.

## Setup

Different [Slack API methods](https://docs.slack.dev/reference/methods) require different [scopes](https://docs.slack.dev/reference/scopes), but setup should be similar for all methods:
Different [Slack API methods](/reference/methods) require different [scopes](/reference/scopes), but setup should be similar for all methods:

1. [Create a Slack app](https://api.slack.com/apps/new) for your workspace or use an existing app.
2. Depending on the Slack API [method](https://docs.slack.dev/reference/methods) you wish to call, add the required **scopes** to your app under the **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
2. Depending on the Slack API [method](/reference/methods) you wish to call, add the required **scopes** to your app under the **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
3. Install the app to your workspace using the **Install App** page.
4. Once your app is installed to a workspace, a new [token](https://docs.slack.dev/authentication/tokens) with your app's specified scopes will be minted for that workspace. It is worth noting that tokens are only valid for a single workspace! Find the token on the **OAuth & Permissions** page.
4. Once your app is installed to a workspace, a new [token](/authentication/tokens) with your app's specified scopes will be minted for that workspace. It is worth noting that tokens are only valid for a single workspace! Find the token on the **OAuth & Permissions** page.
5. Add the token as [a repository secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) called `SLACK_BOT_TOKEN` or something similar and memorable.
6. [Add this Action as a step](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsteps) to your GitHub workflow and provide an input payload to send to the method.

Methods that require an app configuration token should gather this token from the [app configuration token](https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests#config-tokens) settings instead of from a specific app since this token is associated with the workspace.
Methods that require an app configuration token should gather this token from the [app configuration token](/app-manifests/configuring-apps-with-app-manifests#config-tokens) settings instead of from a specific app since this token is associated with the workspace.

## Usage

Choosing inputs for these steps is left as an exercise for the actioneer since each of the Slack API methods requires certain values and specific parameters, but these snippets might be helpful when starting.

### Posting a message with text

Posting a message with the [`chat.postMessage`](https://docs.slack.dev/reference/methods/chat.postMessage) method can be achieved by adding this step to a job in your GitHub workflow and inviting the bot associated with your app to the channel for posting:
Posting a message with the [`chat.postMessage`](/reference/methods/chat.postMessage) method can be achieved by adding this step to a job in your GitHub workflow and inviting the bot associated with your app to the channel for posting:

```yaml
- name: Post text to a Slack channel
Expand All @@ -40,7 +40,7 @@ Posting a message with the [`chat.postMessage`](https://docs.slack.dev/reference

### Posting a message with blocks

More complex message layouts, such as messages made with [Block Kit](https://docs.slack.dev/block-kit/) blocks, can also be sent with one of the Slack API methods:
More complex message layouts, such as messages made with [Block Kit](/block-kit/) blocks, can also be sent with one of the Slack API methods:

```yaml
- name: Post blocks to a Slack channel
Expand All @@ -60,7 +60,7 @@ More complex message layouts, such as messages made with [Block Kit](https://doc

### Updating a message

Updating a message after it's posted can be done with the [`chat.update`](https://docs.slack.dev/reference/methods/chat.update) method and chaining multiple steps together using outputs from past steps as inputs to current ones:
Updating a message after it's posted can be done with the [`chat.update`](/reference/methods/chat.update) method and chaining multiple steps together using outputs from past steps as inputs to current ones:

```yaml
- name: Initiate the deployment launch sequence
Expand Down Expand Up @@ -99,7 +99,7 @@ Updating a message after it's posted can be done with the [`chat.update`](https:

### Replying to a message

Posting [threaded replies to a message](https://docs.slack.dev/messaging/#threading) from a past job can be done by including the `thread_ts` attribute of the parent message in the `payload`:
Posting [threaded replies to a message](/messaging/#threading) from a past job can be done by including the `thread_ts` attribute of the parent message in the `payload`:

```yaml
- name: Initiate a deployment
Expand All @@ -124,7 +124,7 @@ Posting [threaded replies to a message](https://docs.slack.dev/messaging/#thread

### Uploading a file

Calling [a Slack API method](https://docs.slack.dev/reference/methods) with [`@slack/web-api`](https://tools.slack.dev/node-slack-sdk/web-api) makes [uploading a file](https://docs.slack.dev/messaging/working-with-files#uploading_files) just another API call with all of the convenience of the [`files.uploadV2`](https://tools.slack.dev/node-slack-sdk/web-api/#upload-a-file) method:
Calling [a Slack API method](/reference/methods) with [`@slack/web-api`](/tools/node-slack-sdk/web-api/) makes [uploading a file](/messaging/working-with-files#uploading_files) just another API call with all of the convenience of the [`files.uploadV2`](/tools/node-slack-sdk/web-api/#upload-a-file) method:

```yaml
- name: Share a file to that channel
Expand All @@ -141,5 +141,5 @@ Calling [a Slack API method](https://docs.slack.dev/reference/methods) with [`@s

## Example workflows

* [**Direct message the author**](/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/direct-message-author): Write to the Slack user with a matching email.
* [**Invite a usergroup to channel**](/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/invite-usergroup-to-channel): Create a channel and invite members.
- [**Direct message the author**](/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/direct-message-author): Write to the Slack user with a matching email.
- [**Invite a usergroup to channel**](/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/invite-usergroup-to-channel): Create a channel and invite members.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ sidebar_label: Overview

# Sending data as a message with a Slack incoming webhook URL

This technique uses this Action to post a message to a channel or direct message with [incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks) and a Slack app.
This technique uses this Action to post a message to a channel or direct message with [incoming webhooks](/messaging/sending-messages-using-incoming-webhooks) and a Slack app.

Incoming webhooks follow the same [formatting](https://docs.slack.dev/apis/) patterns as other Slack messaging APIs. Posted messages can be as short as a single line of text, include additional interactivity with [interactive components](https://docs.slack.dev/messaging/creating-interactive-messages), or be formatted with [Block Kit](https://docs.slack.dev/block-kit/) to build visual components.
Incoming webhooks follow the same [formatting](/apis/) patterns as other Slack messaging APIs. Posted messages can be as short as a single line of text, include additional interactivity with [interactive components](/messaging/creating-interactive-messages), or be formatted with [Block Kit](/block-kit/) to build visual components.

## Setup

Gather a Slack incoming webhook URL:

1. [Create a Slack app](https://api.slack.com/apps/new) for your workspace or use an existing app.
2. Add the [`incoming-webhook`](https://docs.slack.dev/reference/scopes/incoming-webhook) bot scope under **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
2. Add the [`incoming-webhook`](/reference/scopes/incoming-webhook) bot scope under **OAuth & Permissions** page on [app settings](https://api.slack.com/apps).
3. Install the app to your workspace and select a channel to notify from the **Install App** page.
4. Create additional webhooks from the **Incoming Webhooks** page.
5. Add the generated incoming webhook URL as [a repository secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) called `SLACK_WEBHOOK_URL`.
Expand All @@ -27,7 +27,7 @@ https://hooks.slack.com/services/T0123456789/B1001010101/7IsoQTrixdUtE971O1xQTm4

## Usage

Add the collected webhook from above to a GitHub workflow and configure the step using [`mrkdwn`](https://docs.slack.dev/messaging/formatting-message-text) formatting values for a message or [Block Kit](https://docs.slack.dev/block-kit/) blocks:
Add the collected webhook from above to a GitHub workflow and configure the step using [`mrkdwn`](/messaging/formatting-message-text) formatting values for a message or [Block Kit](/block-kit/) blocks:

```yaml
- name: Post a message in a channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This workflow converts build outputs from earlier GitHub Action steps into a Slack message.

This example uses data from a payload file to [send a message](https://tools.slack.dev/deno-slack-sdk/reference/slack-functions/send_message) to a hardcoded channel.
This example uses data from a payload file to [send a message](/tools/deno-slack-sdk/reference/slack-functions/send_message/) to a hardcoded channel.

## Files

### Payload file being sent
### Payload file being sent

```js reference
https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Technique_1_Slack_Workflow_Builder/builds.data.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This workflow allows you to select a channel to post news about the most recent release to.

This example uses [Slack functions](https://tools.slack.dev/deno-slack-sdk/guides/creating-slack-functions) and inline inputs to do the
This example uses [Slack functions](/tools/deno-slack-sdk/guides/creating-slack-functions/) and inline inputs to do the
following:

1. Open a form to select a channel.
Expand All @@ -11,7 +11,7 @@ following:

## Files

### GitHub Actions workflow
### GitHub Actions workflow

```js reference
https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Technique_1_Slack_Workflow_Builder/announcements.gha.yml
Expand All @@ -27,4 +27,5 @@ https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Tech

```js reference
https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Technique_1_Slack_Workflow_Builder/announcements.trigger.json
```
```

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This workflow shows the latest commit status in the header of a channel.

This example uses the default GitHub event [context](https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L6) and [payload](https://docs.github.com/en/webhooks/webhook-events-and-payloads) to [update a channel topic](https://tools.slack.dev/deno-slack-sdk/reference/slack-functions/update_channel_topic).
This example uses the default GitHub event [context](https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L6) and [payload](https://docs.github.com/en/webhooks/webhook-events-and-payloads) to [update a channel topic](/tools/deno-slack-sdk/reference/slack-functions/update_channel_topic/).

## Related files

Expand All @@ -22,4 +22,5 @@ https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Tech

```js reference
https://github.com/slackapi/slack-github-action/blob/main/example-workflows/Technique_1_Slack_Workflow_Builder/topic.trigger.json
```
```

Loading