From 330a385f9e060824e63ad886bd3a97140217e6e6 Mon Sep 17 00:00:00 2001 From: Junichi Sato <22004610+sato11@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:28:03 +0900 Subject: [PATCH] Document that `gh run download` downloads the latest artifact by default This commit addresses the documentation issue. The discussion at #7018 has confirmed that it is undocumented that the current behavior of `gh run download` with `-n` and no `run-id` downloads the latest artifact. Although the behavior has not been created intentionally, it is the one that should be documented and the future releases should warn before a breaking change. --- pkg/cmd/run/download/download.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/run/download/download.go b/pkg/cmd/run/download/download.go index 18a10df80..99ec45bbe 100644 --- a/pkg/cmd/run/download/download.go +++ b/pkg/cmd/run/download/download.go @@ -42,13 +42,17 @@ func NewCmdDownload(f *cmdutil.Factory, runF func(*DownloadOptions) error) *cobr cmd := &cobra.Command{ Use: "download []", Short: "Download artifacts generated by a workflow run", - Long: heredoc.Doc(` + Long: heredoc.Docf(` Download artifacts generated by a GitHub Actions workflow run. The contents of each artifact will be extracted under separate directories based on the artifact name. If only a single artifact is specified, it will be extracted into the current directory. - `), + + By default, this command downloads the latest artifact created and uploaded through + GitHub Actions. Because workflows can delete or overwrite artifacts, %[1]s%[1]s + must be used to select an artifact from a specific workflow run. + `, "`"), Args: cobra.MaximumNArgs(1), Example: heredoc.Doc(` # Download all artifacts generated by a workflow run