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
5 changes: 5 additions & 0 deletions cmd/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
"",
"If there are any, then you will be prompted to upgrade",
"",
"In non-interactive environments (CI/CD, scripts, piped output),",
"update checks still run but the auto-update prompt is skipped.",
"To suppress update checks entirely on other commands, use",
"--skip-update or set SLACK_SKIP_UPDATE.",
"",
fmt.Sprintf(`The changelog can be found at {{LinkText "%s"}}`, changelogURL),
}, "\n"),
Example: style.ExampleCommandsf([]style.ExampleCommand{
Expand Down
5 changes: 5 additions & 0 deletions docs/guides/authorizing-the-slack-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Once a day, the Slack CLI checks for updates after running any command. When an

Update notifications can be disabled using a command-line flag or an environment variable. When running any command, you can append the `--skip-update` or `-s` flag. Alternatively, you can set the `SLACK_SKIP_UPDATE` environment variable and assign it any value.

When the CLI runs in a non-interactive environment, such as inside a CI/CD pipeline or when the output is piped, the update check runs without the auto-update confirmation prompt. The notification text may still appear in command output, however. You can suppress the check entirely with the `--skip-update` flag or `SLACK_SKIP_UPDATE` environment variable to keep the automation output clean.

:::info[The `--skip-update` flag and the `SLACK_SKIP_UPDATE` environment variable are intentionally ignored when running the `slack upgrade` command directly, since that command's purpose is to check for updates.
:::

## CI/CD authorization {#ci-cd}

Setting up a CI/CD pipeline requires authorization using a service token. Service tokens are **long-lived, non-rotatable user tokens** — they won't expire, so they can be used to perform any Slack CLI action without the need to refresh tokens.
Expand Down
4 changes: 4 additions & 0 deletions docs/guides/setting-up-ci-cd-with-the-slack-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ You'll also need to accommodate requests from your network to a variety of hosts

In addition, you'll need to obtain a service token to authorize your CI/CD setup. Refer to [CI/CD authorization](/tools/slack-cli/guides/authorizing-the-slack-cli#ci-cd) for more details about obtaining, using, and revoking service tokens.

### Disabling update checks {#disable-updates}

In CI/CD pipelines, set a `SLACK_SKIP_UPDATE` environment variable to `1` (or pass `--skip-update` on each command) to prevent the CLI from checking for new versions on every run. See [Version update notifications](/tools/slack-cli/guides/authorizing-the-slack-cli#version-updates) for details.

Once you've done those things, you're ready to get started! Let's walk through an example.

Let's take a look at the [Virtual Running Buddies sample app](https://github.com/slack-samples/deno-virtual-running-buddies).
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/commands/slack_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Checks for available updates to the CLI or the SDKs of a project

If there are any, then you will be prompted to upgrade

In non-interactive environments (CI/CD, scripts, piped output),
update checks still run but the auto-update prompt is skipped.
To suppress update checks entirely on other commands, use
--skip-update or set SLACK_SKIP_UPDATE.

The changelog can be found at [https://docs.slack.dev/changelog](https://docs.slack.dev/changelog)

```
Expand Down
Loading