Skip to content
Merged
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ Use this GitHub Action to:

We recommend using the latest version of this Action for the most recent updates and fixes.

Migration guides are available in the [release notes](https://github.com/slackapi/slack-github-action/releases) with breaking changes noted between versions.

Changes required when upgrading from `@v1` to `@v2` are included in this [migration guide](https://github.com/slackapi/slack-github-action/releases/tag/v2.0.0).
Changes are logged in the [release notes](https://github.com/slackapi/slack-github-action/releases) with migration guides available for updating from `@v1` to the [`@v2`](https://github.com/slackapi/slack-github-action/releases/tag/v2.0.0) and [`@v3`](https://github.com/slackapi/slack-github-action/releases/tag/v3.0.0) releases.

### License

Expand Down
12 changes: 6 additions & 6 deletions docs/additional-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The `errors` option defaults to `false` so failed requests do not cause the step

```yaml
- name: Attempt to call an unknown method
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: chat.reverse
Expand All @@ -29,7 +29,7 @@ The `payload-delimiter` option will flatten the input payload using the provided

```yaml
- name: Flatten the default GitHub payload
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-delimiter: "_"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -44,7 +44,7 @@ Additional variables provided in the GitHub event [context](https://github.com/a

```yaml
- name: Send custom JSON data to Slack workflow
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-file-path: "./payload-slack-content.json"
payload-templated: true
Expand All @@ -60,7 +60,7 @@ If you need to use a proxy to connect to Slack, you can use the `proxy` option.

```yaml
- name: Post to a Slack channel via a proxy
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
proxy: "http://proxy.example.org:8080" # Change this to a custom value
Expand All @@ -85,7 +85,7 @@ The `retries` option can be configured to the needs of your workflow with one of

```yaml
- name: Attempt a burst of requests
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
retries: RAPID
Expand All @@ -103,7 +103,7 @@ In certain circumstances, such as testing the sent payload, a [custom API URL](/

```yaml
- name: Send to a custom API URL
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
api: http://localhost:8080
method: chat.postMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pass a [service token](/authentication/tokens/) via the `token` input. This is a
By default, the latest version of the Slack CLI is installed. To pin a specific version, use the `version` input:

```yaml
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "version"
version: "3.14.0"
Expand All @@ -32,7 +32,7 @@ If the `slack` command already exists on `PATH`, installation is skipped entirel
Provide a `command` input with the Slack CLI command to run, omitting the `slack` prefix.

```yaml
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "version"
```
Expand All @@ -42,7 +42,7 @@ Provide a `command` input with the Slack CLI command to run, omitting the `slack
When a workflow is re-run with **Enable debug logging**, the action automatically appends `--verbose` to the CLI command. You can also include `--verbose` in your `command` input manually at any time.

```yaml
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "deploy --app ${{ vars.SLACK_APP_ID }} --verbose"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}
Expand All @@ -64,7 +64,7 @@ The following outputs are available after a CLI command runs:

```yaml
steps:
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
id: slack
with:
command: "version"
Expand All @@ -76,7 +76,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "manifest validate --app ${{ vars.SLACK_APP_ID }}"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}
Expand All @@ -87,7 +87,7 @@ steps:
```yaml
steps:
- uses: actions/checkout@v4
- uses: slackapi/slack-github-action/cli@v2
- uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "deploy --app ${{ vars.SLACK_APP_ID }} --force"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Posting a message with the [`chat.postMessage`](/reference/methods/chat.postMess

```yaml
- name: Post text to a Slack channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -44,7 +44,7 @@ More complex message layouts, such as messages made with [Block Kit](/block-kit/

```yaml
- name: Post blocks to a Slack channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -65,7 +65,7 @@ Updating a message after it's posted can be done with the [`chat.update`](/refer
```yaml
- name: Initiate the deployment launch sequence
id: launch_sequence
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -81,7 +81,7 @@ Updating a message after it's posted can be done with the [`chat.update`](/refer
- name: Countdown until launch
run: sleep 10
- name: Update the original message with success
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.update
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -103,7 +103,7 @@ Posting [threaded replies to a message](/messaging/#threading) from a past job c

```yaml
- name: Initiate a deployment
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
id: deployment_message
with:
method: chat.postMessage
Expand All @@ -112,7 +112,7 @@ Posting [threaded replies to a message](/messaging/#threading) from a past job c
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: "Deployment started :eyes:"
- name: Conclude the deployment
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -128,7 +128,7 @@ Calling [a Slack API method](/reference/methods) with [`@slack/web-api`](/tools/

```yaml
- name: Share a file to that channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: files.uploadV2
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Add the collected webhook from above to a GitHub workflow and configure the step

```yaml
- name: Post a message in a channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In the example below, the default GitHub event [context](https://github.com/acti

```yaml
- name: Send GitHub Action data to a Slack workflow
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-delimiter: "_"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -49,7 +49,7 @@ Provided input values for payload information are sent to the webhook URL after

```yaml
- name: Send custom event details to a Slack workflow
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
Expand All @@ -64,7 +64,7 @@ Input values for the payload to be sent can also be provided in a file, either i

```yaml
- name: Send a saved artifact to a Slack workflow
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-file-path: "./artifacts.json"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
4 changes: 2 additions & 2 deletions docs/sending-techniques/sending-techniques.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ The following snippet shows how multiple steps can be chained together to create
```yaml
- name: Create a new Slack channel for recent changes
id: conversation
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: conversations.create
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
name: pull-request-review-${{ github.sha }}
- name: Send the pull request link into the Slack channel
if: ${{ steps.conversation.outputs.ok }}
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand Down
4 changes: 1 addition & 3 deletions docs/slack-github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ The GitHub Action for sending data to Slack and running commands.

We recommend using the latest version of this GitHub Action for the most recent updates and fixes.

Migration guides are available in the [release notes](https://github.com/slackapi/slack-github-action/releases) with breaking changes noted between versions.

Changes required when upgrading from `@v1` to `@v2` are included in this [migration guide](https://github.com/slackapi/slack-github-action/releases/tag/v2.0.0).
Changes are logged in the [release notes](https://github.com/slackapi/slack-github-action/releases) with migration guides available for updating from `@v1` to the [`@v2`](https://github.com/slackapi/slack-github-action/releases/tag/v2.0.0) and [`@v3`](https://github.com/slackapi/slack-github-action/releases/tag/v3.0.0) releases.

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Draft with these release notes details
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
persist-credentials: false

- name: Start the Slack workflow
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-file-path: "./example-workflows/Technique_1_Slack_Workflow_Builder/builds.data.json"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update the channel topic
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-delimiter: "_"
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
4 changes: 2 additions & 2 deletions example-workflows/Technique_2_Slack_API_Method/author.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Find correspondences
id: email
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
method: users.lookupByEmail # https://docs.slack.dev/reference/methods/users.lookupByEmail/
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -30,7 +30,7 @@ jobs:

- name: Send a direct message
if: ${{ steps.email.outputs.ok }}
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: chat.postMessage # https://docs.slack.dev/reference/methods/chat.postMessage/
Expand Down
8 changes: 4 additions & 4 deletions example-workflows/Technique_2_Slack_API_Method/invite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Create a new Slack channel for communications
id: conversation
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: conversations.create # https://docs.slack.dev/reference/methods/conversations.create/
Expand All @@ -22,7 +22,7 @@ jobs:
name: issue-${{ github.event.issue.number }}

- name: Send the issue link into the Slack channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: chat.postMessage # https://docs.slack.dev/reference/methods/chat.postMessage/
Expand All @@ -33,7 +33,7 @@ jobs:

- name: Gather information of those to add
id: members
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: usergroups.users.list # https://docs.slack.dev/reference/methods/usergroups.users.list/
Expand All @@ -47,7 +47,7 @@ jobs:
echo "SLACK_USERGROUP_USER_IDS=$SLACK_USERGROUP_USER_IDS" >> $GITHUB_ENV

- name: Add the usergroup to the channel
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: conversations.invite # https://docs.slack.dev/reference/methods/conversations.invite/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Write the review
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
persist-credentials: false

- name: Forward a saved message
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
payload-file-path: "./example-workflows/Technique_3_Slack_Incoming_Webhook/saved.data.json"
payload-templated: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Greet the reader
uses: slackapi/slack-github-action@v2.1.1
uses: slackapi/slack-github-action@v3.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Look up the Slack user by email
id: email
uses: slackapi/slack-github-action@v2
uses: slackapi/slack-github-action@v3.0.0
with:
method: users.lookupByEmail # https://docs.slack.dev/reference/methods/users.lookupByEmail/
token: ${{ secrets.SLACK_BOT_TOKEN }}
Expand All @@ -42,14 +42,14 @@ jobs:

- name: Add or remove the collaborator
if: ${{ steps.email.outputs.ok }}
uses: slackapi/slack-github-action/cli@v2
uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "collaborators ${{ inputs.add && 'add' || 'remove' }} ${{ inputs.email }} --app ${{ vars.SLACK_APP_ID }}"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}

- name: Post a confirmation message
if: ${{ steps.email.outputs.ok }}
uses: slackapi/slack-github-action@v2
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: chat.postMessage # https://docs.slack.dev/reference/methods/chat.postMessage/
Expand Down
4 changes: 2 additions & 2 deletions example-workflows/Technique_4_Slack_CLI_Command/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
persist-credentials: false

- name: Deploy the app
uses: slackapi/slack-github-action/cli@v2
uses: slackapi/slack-github-action/cli@v3.0.0
with:
command: "deploy --app ${{ vars.SLACK_APP_ID }} --force"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}

- name: Post a deployment message
uses: slackapi/slack-github-action@v2
uses: slackapi/slack-github-action@v3.0.0
with:
errors: true
method: chat.postMessage
Expand Down
Loading
Loading