Skip to content

Commit aad8f88

Browse files
docs: clarify update check behavior in non-interactive environments (#556)
* docs: clarify update check behavior in non-interactive environments Document that `slack upgrade` runs the update check but skips the auto-update prompt when no TTY is attached, and that --skip-update / SLACK_SKIP_UPDATE fully suppress checks on other commands. Adds a non-TTY note to the upgrade command's long description, expands the "Version update notifications" section, and links a new "Disabling update checks" subsection from the CI/CD guide. * Update docs/guides/authorizing-the-slack-cli.md Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> * Update docs/guides/authorizing-the-slack-cli.md Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> * Update docs/guides/setting-up-ci-cd-with-the-slack-cli.md Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com> --------- Co-authored-by: Luke Russell <31357343+lukegalbraithrussell@users.noreply.github.com>
1 parent fee9c54 commit aad8f88

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

cmd/upgrade/upgrade.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command {
4040
"",
4141
"If there are any, then you will be prompted to upgrade",
4242
"",
43+
"In non-interactive environments (CI/CD, scripts, piped output),",
44+
"update checks still run but the auto-update prompt is skipped.",
45+
"To suppress update checks entirely on other commands, use",
46+
"--skip-update or set SLACK_SKIP_UPDATE.",
47+
"",
4348
fmt.Sprintf(`The changelog can be found at {{LinkText "%s"}}`, changelogURL),
4449
}, "\n"),
4550
Example: style.ExampleCommandsf([]style.ExampleCommand{

docs/guides/authorizing-the-slack-cli.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ Once a day, the Slack CLI checks for updates after running any command. When an
6363
6464
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.
6565
66+
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.
67+
68+
:::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.
69+
:::
70+
6671
## CI/CD authorization {#ci-cd}
6772

6873
Setting up a CI/CD pipeline requires authorization using a service token. Service tokens are **long-lived, non-rotatable user tokens** &mdash; they won't expire, so they can be used to perform any Slack CLI action without the need to refresh tokens.

docs/guides/setting-up-ci-cd-with-the-slack-cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ You'll also need to accommodate requests from your network to a variety of hosts
5858

5959
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.
6060

61+
### Disabling update checks {#disable-updates}
62+
63+
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.
64+
6165
Once you've done those things, you're ready to get started! Let's walk through an example.
6266

6367
Let's take a look at the [Virtual Running Buddies sample app](https://github.com/slack-samples/deno-virtual-running-buddies).

docs/reference/commands/slack_upgrade.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Checks for available updates to the CLI or the SDKs of a project
88

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

11+
In non-interactive environments (CI/CD, scripts, piped output),
12+
update checks still run but the auto-update prompt is skipped.
13+
To suppress update checks entirely on other commands, use
14+
--skip-update or set SLACK_SKIP_UPDATE.
15+
1116
The changelog can be found at [https://docs.slack.dev/changelog](https://docs.slack.dev/changelog)
1217

1318
```

0 commit comments

Comments
 (0)