Skip to content

feat: support slack cli commands with composite action inputs#560

Open
zimeg wants to merge 43 commits intomainfrom
cli
Open

feat: support slack cli commands with composite action inputs#560
zimeg wants to merge 43 commits intomainfrom
cli

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Feb 25, 2026

Summary

This PR adds support for running Slack CLI commands with this GitHub action:

- uses: slackapi/slack-github-action/cli@v2
  with:
    command: "version"
    version: "3.14.0"
- uses: slackapi/slack-github-action/cli@v2
  with:
    command: "deploy --app ${{ vars.SLACK_APP_ID }} --force"
    token: ${{ secrets.SLACK_SERVICE_TOKEN }}

Follows earlier efforts and explorations of @ewanek1 in #486 #488 #489 👾 ✨

Includes

  • An optional version option to pin the installation to a specific version 🤖
  • An optional token option for authenticated commands
  • A required command option to run with the Slack CLI 🪩
  • Verbose logs when rerun in debug mode - Example logs 🔭
  • Examples of possible use patterns within kind preview 📚

Notes

  • The "nested" structure is recommendation of @WilliamBergamin and I find it makes inputs and outputs of this step much more clear for documentation sake! An earlier approach in ae50e2e demonstrates the "combined" setup.

Requirements

@zimeg zimeg self-assigned this Feb 25, 2026
@zimeg zimeg added enhancement New feature or request semver:minor labels Feb 25, 2026
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.92%. Comparing base (3ffcfc3) to head (4500857).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #560   +/-   ##
=======================================
  Coverage   95.92%   95.92%           
=======================================
  Files          14       14           
  Lines        2697     2697           
=======================================
  Hits         2587     2587           
  Misses        110      110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

🐙 Leaving notes for the wonderful reviewers after changes have become more stable in recent testing!

Comment on lines +27 to +28
> **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.
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.

Comment on lines +41 to +43
include: |
dist/**/*
cli/**/*
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

Copy link
Member Author

Choose a reason for hiding this comment

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

🪵 Logs

Copy link
Member Author

Choose a reason for hiding this comment

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

🪵 Logs

Copy link
Member Author

Choose a reason for hiding this comment

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

🪵 Logs

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.

Comment on lines +37 to +44
- name: Cache Slack CLI
if: steps.slack-cli-check.outputs.exists != 'true' && inputs.version != ''
id: cache-cli
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
${{ runner.os == 'Windows' && '~/AppData/Local/slack-cli' || '~/.slack/bin' }}
key: slack-cli-${{ runner.os }}-${{ runner.arch }}-${{ inputs.version }}
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 avoid caching when latest is used since a missing "version" input can cause stale installations. FWIW both a "clean" install and cached install are fast at around 4 seconds:

🔗 https://github.com/slackapi/slack-github-action/actions/runs/22533375996/job/65276385295#step:3:27

Cache hit for: slack-cli-Linux-X64-3.14.0
Received 7465485 of 7465485 (100.0%), 7.5 MBs/sec
Cache Size: ~7 MB (7465485 B)

Comment on lines +1 to 3
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"
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.

Comment on lines -254 to -257
codecov_token: ${{ secrets.CODECOV_API_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
extension: js
include: src
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.

@zimeg zimeg added this to the 2.2 milestone Mar 1, 2026
@zimeg zimeg marked this pull request as ready for review March 1, 2026 02:27
@zimeg zimeg requested review from a team as code owners March 1, 2026 02:27
@zimeg zimeg requested a review from WilliamBergamin March 1, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants