Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ae50e2e
feat: cli
zimeg Feb 25, 2026
165d9f6
feat: cli
zimeg Feb 25, 2026
2d8c996
fix: echo output
zimeg Feb 25, 2026
077f882
ci: use development build
zimeg Feb 25, 2026
35b8102
fix: add to windows path
zimeg Feb 25, 2026
5d5197b
ci: remove feature build cli version
zimeg Feb 25, 2026
613ab73
test: verbose version
zimeg Feb 25, 2026
47ed37c
fix: run windows build in powershell
zimeg Feb 25, 2026
4e7d5d3
ci: dev
zimeg Feb 25, 2026
f50140b
ci: debug
zimeg Feb 25, 2026
b48e5cf
ci: tee output
zimeg Feb 25, 2026
32371dd
test: write empty credentials for windows tests for io speed
zimeg Feb 25, 2026
059f8f3
test: attempt to create all windows files or quit
zimeg Feb 25, 2026
eaed8db
build: use .net api for better diagnostics
zimeg Feb 25, 2026
65f25ff
test: remove debug from windows
zimeg Feb 25, 2026
4b307de
chore: remove verbose flag option
zimeg Feb 25, 2026
2d3baa1
fix: remove duplicate output for unix
zimeg Feb 25, 2026
c6baa4b
test: improve checks of existing cache or path
zimeg Feb 25, 2026
8607d1d
test: latest cli release
zimeg Feb 27, 2026
d343286
style: prefix steps with a shell format
zimeg Feb 28, 2026
e2bce82
style: make more clear other steps with mirrored shells
zimeg Feb 28, 2026
fc6915d
chore: remove unused id from steps
zimeg Feb 28, 2026
6f7dc50
test: app and token request
zimeg Feb 28, 2026
ddae541
ci: use manifest of the project
zimeg Feb 28, 2026
4a0cf78
ci: gather app id from variables
zimeg Feb 28, 2026
d8247ad
test: echo app settings
zimeg Feb 28, 2026
3698dd9
feat: debug: verbose
zimeg Feb 28, 2026
8a37599
test: confirm action outputs
zimeg Feb 28, 2026
86c95e5
revert: return ids of outputs
zimeg Feb 28, 2026
809cf5c
ci: confirm unknown commands error
zimeg Feb 28, 2026
c73fa17
style: remove repeated outputs of a failed process
zimeg Feb 28, 2026
069243d
chore: merge w main
zimeg Feb 28, 2026
5d9cb89
docs: example
zimeg Feb 28, 2026
ae9124d
docs: redirect
zimeg Feb 28, 2026
4aab456
docs: versions
zimeg Feb 28, 2026
2d9b061
docs: recommend more focused best practices
zimeg Feb 28, 2026
03b6946
docs: rebrand without 'send'
zimeg Feb 28, 2026
638743f
build: cache to globbed directories
zimeg Mar 1, 2026
671d51b
docs: extend links in github readmes
zimeg Mar 1, 2026
1003081
docs: fix examples
zimeg Mar 1, 2026
22fc69b
build: skip cache when no version is pinned
zimeg Mar 1, 2026
cba9656
docs: add errors to message posting examples
zimeg Mar 1, 2026
4500857
docs: fallback to real name when display name is empty
zimeg Mar 1, 2026
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
1 change: 1 addition & 0 deletions .github/resources/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
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_SERVICE_TOKEN=xoxp-01010101-example
export SLACK_WEBHOOK_TRIGGER=https://hooks.slack.com/triggers/T0123456789/00000000000/abcdefghijklmnopqrstuvwxyz
4 changes: 3 additions & 1 deletion .github/resources/.slack/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"experiments": ["bolt"],
"manifest": {
"source": "local"
},
"project_id": "c4805b41-d1ce-4ea0-b297-ed2f8c64c267"
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"runtime": "actions",
"hooks": {
"deploy": "open https://api.slack.com/apps || true",
"deploy": "echo https://api.slack.com/apps",
"get-manifest": "cat ./.slack/manifest.json #"
},
"config": {
Expand Down
10 changes: 9 additions & 1 deletion .github/resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ experiments with the [Slack CLI][cli].

## Overview

This app showcases all three techniques of sending data into Slack and follows
This app showcases all four techniques of interacting with Slack and follows
patterns found in the integration tests.

- **Technique 1** Slack Workflow Builder: Use a Slack webhook trigger to start a
Expand All @@ -15,13 +15,18 @@ patterns found in the integration tests.
data provided through the GitHub workflow.
- **Technique 3** Incoming webhook: Post a message to a Slack channel using an
incoming webhook.
- **Technique 4** Slack CLI Command: Install and run Slack CLI commands such as
`deploy` or `manifest` using a service token.

Configurations for the Slack app and workflow, and the GitHub Actions workflow
are found in the following files:

- Slack app setup: [`.github/resources/.slack/manifest.json`][slacktion]
- GitHub Actions steps: [`.github/workflows/develop.yml`][develop]

> **Note:** During CLI integration tests, `.github/resources/.slack` is moved to
> `.slack` at the project root so the Slack CLI can discover the app manifest.
Comment on lines +27 to +28
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thought: This might be a limitation of the CLI at the moment. I think patterns exist elsewhere toward this, but I'm curious if an option in this action makes more sense...

       -C <path>
           Run as if git was started in <path> instead of the current working directory.


Either the techniques or app setup and workflow steps can be adjusted during
testing and development. For experimenting with new changes, we recommend using
the [steps for development](#experimenting-for-development) while the
Expand Down Expand Up @@ -76,6 +81,8 @@ tested. Required values include:
https://hooks.slack.com/services/T0123456789/B0123456789/abcdefghijklmnopqrstuvwxyz
- `SLACK_WEBHOOK_TRIGGER`:
https://hooks.slack.com/triggers/T0123456789/00000000000/abcdefghijklmnopqrstuvwxyz
- `SLACK_SERVICE_TOKEN`: xoxp-service-token-example (secret — for CLI commands)
- `SLACK_APP_ID`: A0123456789 (variable — used with `--app` flag in CLI deploy)

### Experimenting for development

Expand All @@ -98,6 +105,7 @@ 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
export SLACK_SERVICE_TOKEN=xoxp-service-token-example
```

Environment variables and credentials should be set in the created `.env` file
Expand Down
120 changes: 93 additions & 27 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
integration:
name: Run integration tests
name: Run API tests
runs-on: ubuntu-latest
environment: staging
permissions:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
env:
INPUT_REF: ${{ inputs.ref }}

- name: "integration(wfb): send a payload to workflow builder via webhook trigger"
- name: "test(wfb): send a payload to workflow builder via webhook trigger"
id: wfb
uses: ./
with:
Expand All @@ -82,12 +82,12 @@ jobs:
repo_name: ${{ github.event.repository.full_name }}
status: ${{ job.status }}

- name: "integration(wfb): confirm a payload was sent"
- name: "test(wfb): confirm a payload was sent"
run: test -n "$WFB_OUTPUT_TIME"
env:
WFB_OUTPUT_TIME: ${{ steps.wfb.outputs.time }}

- name: "integration(botToken): post a message to channel"
- name: "test(api): post a message to channel"
id: message
uses: ./
with:
Expand All @@ -98,12 +98,12 @@ jobs:
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: ":checkered_flag: Action happens at <https://github.com/${{ github.repository }}>"

- name: "integration(method): confirm a message was posted"
- name: "test(api): confirm a message was posted"
run: test -n "$MESSAGE_OUTPUT_TS"
env:
MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }}

- name: "integration(method): post a message with blocks"
- name: "test(api): post a message with blocks"
id: blocks
uses: ./
with:
Expand All @@ -120,12 +120,12 @@ jobs:
short: true
value: "Processing"

- name: "integration(method): confirm the blocks were posted"
- name: "test(api): confirm the blocks were posted"
run: test -n "$BLOCKS_OUTPUT_TS"
env:
BLOCKS_OUTPUT_TS: ${{ steps.blocks.outputs.ts }}

- name: "integration(method): post a threaded message"
- name: "test(api): post a threaded message"
id: timer
uses: ./
with:
Expand All @@ -137,15 +137,15 @@ jobs:
text: "Started at `${{ steps.blocks.outputs.time }}`"
thread_ts: "${{ steps.blocks.outputs.ts }}"

- name: "integration(incoming): confirm the thread started"
- name: "test(api): confirm the thread started"
run: test -n "$TIMER_OUTPUT_TIME"
env:
TIMER_OUTPUT_TIME: ${{ steps.timer.outputs.time }}

- name: "integration(method): wait to mock event processing"
- name: "test(api): wait to mock event processing"
run: sleep 3

- name: "integration(method): update the original message"
- name: "test(api): update the original message"
id: finished
uses: ./
with:
Expand All @@ -163,7 +163,7 @@ jobs:
short: true
value: "Completed"

- name: "integration(method): post another threaded message"
- name: "test(api): post another threaded message"
id: done
uses: ./
with:
Expand All @@ -175,7 +175,7 @@ jobs:
text: "Finished at `${{ steps.finished.outputs.time }}`"
thread_ts: "${{ steps.timer.outputs.thread_ts }}"

- name: "integration(method): post a file into a channel"
- name: "test(api): post a file into a channel"
id: file
uses: ./
with:
Expand All @@ -188,7 +188,7 @@ jobs:
file: .github/workflows/integration.yml
filename: integration.yml

- name: "integration(method): react to the completed update message"
- name: "test(api): react to the completed update message"
uses: ./
with:
errors: true
Expand All @@ -199,38 +199,38 @@ jobs:
timestamp: ${{ steps.blocks.outputs.ts }}
name: "tada"

- name: "integration(method): confirm the thread ended"
- name: "test(api): confirm the thread ended"
run: test -n "$DONE_OUTPUT_TIME"
env:
DONE_OUTPUT_TIME: ${{ steps.done.outputs.time }}

- name: "integration(incoming): post a message via incoming webhook"
- name: "test(incoming): post a message via incoming webhook"
id: incoming
uses: ./
with:
errors: true
webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
text: "Incoming webhook test for slack send"
text: "Incoming webhook test for the Slack GitHub Action"
blocks:
- type: section
text:
type: plain_text
text: ":link: A message was received via incoming webhook"
emoji: true

- name: "integration(incoming): confirm a webhook was posted"
- name: "test(incoming): confirm a webhook was posted"
run: test -n "$INCOMING_WEBHOOK_OUTPUT_TIME"
env:
INCOMING_WEBHOOK_OUTPUT_TIME: ${{ steps.incoming.outputs.time }}

- name: "integration(incoming): reveal contents of the github payload"
- name: "test(incoming): reveal contents of the github payload"
run: echo "$JSON"
env:
JSON: ${{ toJSON(github) }}

- name: "integration(incoming): post a message via payload file"
- name: "test(incoming): post a message via payload file"
id: payload_file
uses: ./
with:
Expand All @@ -243,15 +243,81 @@ jobs:
JOB_STATUS: ${{ job.status }}
ATTACHMENT_COLOR: ${{ (job.status == 'success' && 'good') || (job.status == 'failure' && 'danger') || 'warning' }}

- name: "integration(incoming): confirm a payload file was posted"
- name: "test(incoming): confirm a payload file was posted"
run: test -n "$PAYLOAD_FILE_OUTPUT_TIME"
env:
PAYLOAD_FILE_OUTPUT_TIME: ${{ steps.payload_file.outputs.time }}

- name: "chore(health): check up on recent changes to the health score"
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
cli:
name: Run CLI tests
runs-on: ${{ matrix.os }}
environment: staging
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
Comment on lines +259 to +261
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💯

permissions:
contents: read
steps:
- name: "build: checkout the latest changes"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ inputs.ref || github.event.pull_request.head.sha || github.sha }}

- name: "test(cli): run a slack cli version check"
id: version
uses: ./cli
with:
command: "version"
version: "3.14.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: "3.14.0"

🧪 note: We pin this version until the next release so that Windows tests pass. A follow up PR is available for after this becomes the latest release in #561!

🗣️ ramble: That PR demonstrates failing installation on Windows, but also that the latest versions are gathered as expected on adjacent runners.


- name: "test(cli): confirm the version check outputs"
shell: bash
run: |
set -ex
[ "$CLI_OK" = "true" ]
echo "$CLI_TIME" | grep -qE '^[0-9]+$'
[ -n "$CLI_RESPONSE" ]
env:
CLI_OK: ${{ steps.version.outputs.ok }}
CLI_RESPONSE: ${{ steps.version.outputs.response }}
CLI_TIME: ${{ steps.version.outputs.time }}

- name: "test(cli): run an unknown command"
id: unknown
continue-on-error: true
uses: ./cli
with:
command: "off"

- name: "test(cli): confirm the unknown command outputs"
shell: bash
run: |
set -ex
[ "$CLI_OK" = "false" ]
echo "$CLI_TIME" | grep -qE '^[0-9]+$'
[ -n "$CLI_RESPONSE" ]
env:
CLI_OK: ${{ steps.unknown.outputs.ok }}
CLI_RESPONSE: ${{ steps.unknown.outputs.response }}
CLI_TIME: ${{ steps.unknown.outputs.time }}

- name: "chore: configure the actioneering application"
shell: bash
run: mv .github/resources/.slack .slack

- name: "test(cli): validate the app manifest"
uses: ./cli
with:
command: "manifest"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}

- name: "test(cli): deploy the app"
uses: ./cli
with:
codecov_token: ${{ secrets.CODECOV_API_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
extension: js
include: src
Comment on lines -254 to -257
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔏 note: This is also removed in #559 but status checks are being reported as error for forked branches at this time.

command: "deploy --app ${{ vars.SLACK_APP_ID }} --hide-triggers --force"
token: ${{ secrets.SLACK_SERVICE_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1
with:
template: javascript-action
include: |
dist/**/*
cli/**/*
Comment on lines +41 to +43
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📠 note: An example build shows both directories and adjacent files exist and work as expected!

📦 https://github.com/zimeg/slack-github-action/tree/v2.2.0-rc.1
🪵 https://github.com/zimeg/deno-github-functions/pull/1/checks

env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Slack Send GitHub Action
# Slack GitHub Action

> the GitHub Action for sending data to Slack
> the GitHub Action for sending data to Slack and running commands

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

Expand All @@ -11,6 +11,7 @@ Use this GitHub Action to:
- [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/).
- [Run Slack CLI commands with a service token](https://docs.slack.dev/tools/slack-github-action/sending-techniques/running-slack-cli-commands/).

## Project details

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Slack: Send to Slack"
name: "Slack GitHub Action"
author: "slackapi"
description: "Send data to Slack to start a Slack workflow in Workflow Builder, call a Slack API method, or post a message into a channel"
Comment on lines +1 to 3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📣 note: We're renaming this action to match the project name and be more generic of the techniques available. This updates the marketplace page from what I understand. The link might change but I don't believe that must be static. Heads up though!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 question: Should we update the description alongside these changes? This might also appear on the marketplace page.

💡 thought: I didn't change it since the techniques served with these inputs are noted here while the CLI is included in separate configurations. Earlier discussion more with @WilliamBergamin hint that we might deprecate the top-level action for:

- slackapi/slack-github-action/api@v3
- slackapi/slack-github-action/bot@v3
- slackapi/slack-github-action/cli@v3
- slackapi/slack-github-action/wfb@v3

But we don't have immediate plans for this.

The "bot" technique also might not be true - it's meant for sending messages with incoming webhooks - but the patterns seem best for separate inputs more! I do think we can still package this action using this same action.yml file.

inputs:
Expand Down
Loading
Loading