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
66 changes: 66 additions & 0 deletions .github/resources/.actions/slack-cli-runner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Slack CLI Installation and Command Runner
description: Download and cache the Slack CLI and run the input command

inputs:
command:
description: "Slack CLI command to run"
required: true
verbose:
description: "Enable verbose output"
required: false
default: 'false'
cli_version:
description: "Slack CLI Version"
required: false
default: '3.6.0'

runs:
using: composite
steps:
- name: Cache Slack CLI
id: cache-cli
uses: actions/cache@v4
with:
path: ~/.slack/bin
key: slack-cli-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cli_version }}

- name: Add Slack CLI to PATH (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: echo "$HOME/.slack/bin" >> "$GITHUB_PATH"

- name: Add Slack CLI to PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin"

- name: Install Slack CLI (Linux/macOS)
if:
(runner.os == 'Linux' || runner.os == 'macOS') &&
(steps.cache-cli.outputs.cache-hit != 'true')
shell: bash
run: |
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash -s -- -v ${{ inputs.cli_version }} --skip-update

- name: Install Slack CLI (Windows)
if:
runner.os == 'Windows' &&
(steps.cache-cli.outputs.cache-hit != 'true')
shell: pwsh
run: |
irm https://downloads.slack-edge.com/slack-cli/install-windows-dev.ps1
Copy link
Member

Choose a reason for hiding this comment

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

📝 note: Changes of dev exist in this PR: slackapi/slack-cli#178

👁️‍🗨️ suggestion: I might've shared an incomplete command with this link too but perhaps this brings better luck? Let's keep note to test this at some point-

Suggested change
irm https://downloads.slack-edge.com/slack-cli/install-windows-dev.ps1
irm https://downloads.slack-edge.com/slack-cli/install-windows-dev.ps1 | iex

Copy link
Author

@ewanek1 ewanek1 Aug 18, 2025

Choose a reason for hiding this comment

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

Luckily I think this let the CLI install properly! Although now it hangs on the very last step in the script. It echoes the command Run slack version --skip-update but doesn't go any further 🤔 Before this I got this error The term 'slack' is not recognized as a name of a cmdlet so I wonder if it has to do with the PATH variable. I'll keep trying to look into this!


- name: Run Slack CLI Command
shell: bash
env:
SLACK_SERVICE_TOKEN: $SLACK_SERVICE_TOKEN
SLACK_BOT_TOKEN: $SLACK_BOT_TOKEN
VERBOSE: ${{ inputs.verbose }}
run: |
echo "Running command: ${{ inputs.command }}"
if [ "${{ inputs.verbose }}" == "true" ]; then
slack ${{ inputs.command }} --verbose --skip-update
else
slack ${{ inputs.command }} --skip-update
fi

39 changes: 39 additions & 0 deletions .github/workflows/slack-cli-github-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Slack CLI Command Runner

on:
workflow_dispatch:
inputs:
command:
description: 'Slack CLI command to run'
required: true
verbose:
description: 'Verbose flag'
type: boolean
default: false
cli_version:
description: 'Slack CLI version'
required: false
default: "latest"

env:
SLACK_DISABLE_TELEMETRY: "true"

jobs:
deploy:
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Install Slack CLI and Run Command
uses: ./.github/.actions/slack-cli-runner
with:
command: ${{ github.event.inputs.command }}
verbose: ${{ github.run_attempt > 1 }}
cli_version: ${{ github.event.inputs.cli_version }}
env:
SLACK_SERVICE_TOKEN: ${{ secrets.SLACK_SERVICE_TOKEN }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}