Visitar URL original
[Design] `gh issue artifact create` · Issue #14525 · cli/cli · GitHub
Skip to content

[Design] gh issue artifact create #14525

Description

@BagToad

gh issue artifact create

Table of Contents

help

Category Scenario
Help create

gh issue artifact create

Category Scenario
Files From a file
Files From a file, with #<name>
Files A file name containing #
Files A file name the server wouldn't accept
Files From several files
No file From standard input
No file From --body
Files A plan, with --type plan
Links From a URL
Links From a URL, without --name
Links From a .url file
Attachments With --attach
Attachments File in another directory
Attachments Working directory fallback
Attachments Several files with --attach
Errors Error: unreferenced attachment
Scripting Piped output
Scripting Piped output with a failure
Errors Error: --name required
Errors Error: nothing to create
Errors Error: --name with several files
Errors Error: files and --body together
Errors Error: --type with a link
Errors Error: unreadable .url file
Errors Error: binary file
Errors Error: empty file
Errors A file over the server's size limit
Errors Error: no write access
Files A symlinked file

help

What is changing
  • Help: Help for gh issue artifact create

create

Input:

$ gh issue artifact create --help

Output:

Source & reproduction
printf 'Create one artifact for each file or URL. A text file becomes a document
named after the file; add `#<name>` to choose a different name. A URL, or a
`.url` Internet Shortcut file, becomes a link; a URL is named after its host.

Artifact names can'\''t contain some characters, such as parentheses. When a
file'\''s name has them, gh drops them: `plan (1).md` is named `plan 1.md`.

Use `--body` to create a single document from text, or `--body-file` to create
one artifact from a file (`-` reads standard input). `--name` sets its name.

Documents are saved as `generic` unless `--type plan` is given. A plan
currently behaves the same as a generic document.


\033[0;1;39mUSAGE\033[0m
  gh issue artifact create {<issue-number> | <issue-url>} [<file>[#<name>] | <url>]... [flags]

\033[0;1;39mALIASES\033[0m
  gh issue artifact add, gh issue artifact new

\033[0;1;39mFLAGS\033[0m
      --attach file      Attach an image or video file, in '\''<file>#<image alt text>'\'' format
  -b, --body string      Content for a single document
  -F, --body-file file   Read content for a single artifact from file (use "-" to read from standard input)
      --name string      Name for a single artifact
      --type string      Type for documents: {generic|plan}

\033[0;1;39mINHERITED FLAGS\033[0m
      --help                     Show help for command
  -R, --repo [HOST/]OWNER/REPO   Select another repository using the [HOST/]OWNER/REPO format

\033[0;1;39mEXAMPLES\033[0m
  # Create a document from a file
  $ gh issue artifact create 142 signin-plan.md

  # Create documents from two files, naming the first
  $ gh issue artifact create 142 '\''docs/signin-plan.md#Sign-in plan'\'' oauth-research.md

  # Create a link
  $ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --name '\''Staging OAuth runbook'\''

  # Create a document from standard input
  $ cat order-sync.log | gh issue artifact create 142 --body-file - --name '\''Order sync log'\''

  # Upload a screenshot that the document references
  $ gh issue artifact create 142 signin-plan.md --attach ./signin-flow.png

\033[0;1;39mLEARN MORE\033[0m
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual
  Learn about exit codes using `gh help exit-codes`
  Learn about accessibility experiences using `gh help accessibility`
' > help-create.ans
freeze help-create.ans --output help-create.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1560

gh issue artifact create

What is changing
  • Files: Create an artifact from a file, named after the file
  • Files: Name an artifact with the text after #, parsed like --attach alt text
  • Files: A # inside a file name works, because the longest existing path wins
  • Files: Characters an artifact name can't contain are removed from names taken from file names
  • Files: Create one artifact per file
  • No file: Create an artifact from standard input, which requires --name
  • No file: Create an artifact from inline text
  • Files: --type plan saves a document as a plan; files still default to generic
  • Links: A URL argument creates a link artifact, named by --name
  • Links: A URL without --name is named after its host
  • Links: A .url Internet Shortcut file creates a link artifact
  • Attachments: Upload images with --attach, rewrite references to them, and append the rest
  • Attachments: A file's Markdown references resolve against that file's directory
  • Attachments: A reference that matches nothing next to its file falls back to the working directory
  • Attachments: With several files, each attachment replaces its references in whichever files use it
  • Errors: With several files, an attachment no file references is an error, and nothing is uploaded or created
  • Scripting: When piped, each artifact gets a <status>\t<number>\t<name>\t<source>\t<reason> line on stdout, in argument order
  • Scripting: When piped, failures are also lines on stdout, with an empty number and a reason, and the command exits 1
  • Errors: Content without a file name needs --name
  • Errors: With no file, URL, --body or --body-file, create fails with a usage error and never reads stdin implicitly
  • Errors: --name only applies when creating one artifact
  • Errors: Files cannot be combined with --body or --body-file
  • Errors: --type only applies to documents, since links come from URLs and .url files
  • Errors: A .url file without a usable URL is rejected before anything is created
  • Errors: Binary files are rejected before anything is created, like gh gist create
  • Errors: An empty or whitespace-only file is rejected before anything is created, like gh gist create
  • Errors: Size limits are the server's; an oversized file fails on its own line while the others are created
  • Errors: Without permission to write artifacts, the API's 404 message is the reason
  • Files: A symlinked file is read like any other file, and named by the path as typed

From a file

Input:

$ gh issue artifact create 142 signin-plan.md

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-file.ans
freeze create-from-file.ans --output create-from-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "signin-plan.md" exists on the issue
  • The artifact body is exactly the contents of signin-plan.md

From a file, with #<name>

Input:

$ gh issue artifact create 142 'docs/signin-plan.md#Sign-in plan'

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Sign-in plan}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-named-from-file.ans
freeze create-named-from-file.ans --output create-named-from-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "Sign-in plan" exists on the issue
  • The artifact body is exactly the contents of docs/signin-plan.md

A file name containing #

Input:

$ printf '# Barista notes\n\nRound 2 feedback.\n' > 'barista-notes#2.md'

Input:

$ gh issue artifact create 142 'barista-notes#2.md#Barista notes round 2'

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Barista notes round 2}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-file-name-with-hash.ans
freeze create-file-name-with-hash.ans --output create-file-name-with-hash.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "Barista notes round 2" exists on the issue
  • The artifact body is exactly the contents of barista-notes#2.md

A file name the server wouldn't accept

Input:

$ printf '# Sign-in plan\n' > 'signin-plan (1).md'

Input:

$ gh issue artifact create 142 'signin-plan (1).md'

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan 1.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-name-cleaned-up.ans
freeze create-name-cleaned-up.ans --output create-name-cleaned-up.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "signin-plan 1.md" exists on the issue

From several files

Input:

$ gh issue artifact create 142 signin-plan.md oauth-research.md

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;32m✓\033[0m Created artifact {{number:7}} ({{artifact_name:oauth-research.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-multiple-files.ans
freeze create-multiple-files.ans --output create-multiple-files.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • Two new generic artifacts named "signin-plan.md" and "oauth-research.md" exist on the issue

From standard input

Input:

$ cat oauth-research.md | gh issue artifact create 142 --name 'OAuth research notes' --body-file -

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:OAuth research notes}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-stdin.ans
freeze create-from-stdin.ans --output create-from-stdin.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "OAuth research notes" exists with the piped content as its body

From --body

Input:

$ gh issue artifact create 142 --name 'Root cause' --body 'The order sync skipped decaf orders.'

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Root cause}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-body.ans
freeze create-from-body.ans --output create-from-body.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "Root cause" exists with the given text as its body

A plan, with --type plan

Input:

$ gh issue artifact create 142 signin-plan.md --type plan

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-plan.ans
freeze create-plan.ans --output create-plan.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new artifact of type "plan" named "signin-plan.md" exists on the issue

From a URL

Input:

$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --name 'Staging OAuth runbook'

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:Staging OAuth runbook}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-from-url.ans
freeze create-link-from-url.ans --output create-link-from-url.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects

From a URL, without --name

Input:

$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:github.com}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-default-name.ans
freeze create-link-default-name.ans --output create-link-default-name.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects

From a .url file

Input:

$ printf '[InternetShortcut]\r\nURL=https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook\r\n' > oauth-runbook.url

Input:

$ gh issue artifact create 142 oauth-runbook.url

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:oauth-runbook.url}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-link-from-url-file.ans
freeze create-link-from-url-file.ans --output create-link-from-url-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects

With --attach

Input:

$ printf '# Sign-in plan\n\n![Sign-in flow](./signin-flow.png)\n' > signin-plan.md

Input:

$ gh issue artifact create 142 signin-plan.md --attach signin-flow.png --attach landing-page.png

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-with-attach.ans
freeze create-with-attach.ans --output create-with-attach.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • The artifact body references an uploaded https://github.com/user-attachments/assets/ URL instead of ./signin-flow.png
  • The uploaded landing-page.png is appended to the end of the artifact body
  • The local signin-plan.md is unchanged

File in another directory

Input:

$ printf '![Sign-in flow](./signin-flow.png)\n' > docs/signin-plan.md

Input:

$ gh issue artifact create 142 docs/signin-plan.md --attach docs/signin-flow.png

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-attach-from-subdirectory.ans
freeze create-attach-from-subdirectory.ans --output create-attach-from-subdirectory.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • The artifact body references the uploaded sign-in flow image in place of ./signin-flow.png
  • Nothing is appended to the body

Working directory fallback

Input:

$ printf '![Menu photo](./menu-photo.png)\n' > /tmp/barista-notes.md

Input:

$ gh issue artifact create 142 /tmp/barista-notes.md --attach ./menu-photo.png

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:barista-notes.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-attach-cwd-fallback.ans
freeze create-attach-cwd-fallback.ans --output create-attach-cwd-fallback.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • The artifact body references the uploaded menu-photo.png in place of ./menu-photo.png
  • Nothing is appended to the body

Several files with --attach

Input:

$ gh issue artifact create 142 signin-plan.md barista-notes.md --attach signin-flow.png

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;32m✓\033[0m Created artifact {{number:7}} ({{artifact_name:barista-notes.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-multiple-with-attach.ans
freeze create-multiple-with-attach.ans --output create-multiple-with-attach.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • Both artifact bodies reference the uploaded signin-flow.png instead of ./signin-flow.png
  • Nothing is appended to either body

Error: unreferenced attachment

Input:

$ gh issue artifact create 142 signin-plan.md barista-notes.md --attach signin-flow.png --attach latte-art.png

Output:

Source & reproduction
printf 'no file references latte-art.png; reference it in a file, or attach it when creating a single artifact
' > create-error-unreferenced-attachment.ans
freeze create-error-unreferenced-attachment.ans --output create-error-unreferenced-attachment.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No asset was uploaded and no artifact was created

Piped output

Input:

$ gh issue artifact create 142 docs/signin-plan.md oauth-research.md | cat

Output:

Source & reproduction
printf 'created\t{{number:6}}\t{{artifact_name:signin-plan.md}}\t{{file_name:docs/signin-plan.md}}\t
created\t{{number:7}}\t{{artifact_name:oauth-research.md}}\t{{file_name:oauth-research.md}}\t
' > create-piped-output.ans
freeze create-piped-output.ans --output create-piped-output.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • Two new generic artifacts exist on the issue, 6 "signin-plan.md" (from docs/signin-plan.md) and 7 "oauth-research.md"

Piped output with a failure

Input:

$ set -o pipefail

Input:

$ gh issue artifact create 142 signin-plan.md oauth-research.md | cat

Output:

Source & reproduction
printf 'created\t{{number:6}}\t{{artifact_name:signin-plan.md}}\t{{file_name:signin-plan.md}}\t
failed\t\t{{artifact_name:oauth-research.md}}\t{{file_name:oauth-research.md}}\tArtifact storage is temporarily unavailable
' > create-piped-partial-failure.ans
freeze create-piped-partial-failure.ans --output create-piped-partial-failure.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • Only the "signin-plan.md" artifact was created

Error: --name required

Input:

$ cat oauth-research.md | gh issue artifact create 142 --body-file -

Output:

Source & reproduction
printf '--name is required when the content has no file name
' > create-error-name-required.ans
freeze create-error-name-required.ans --output create-error-name-required.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360

Error: nothing to create

Input:

$ gh issue artifact create 142

Output:

Source & reproduction
printf 'specify a file or URL, or use `--body` or `--body-file`
' > create-error-no-content.ans
freeze create-error-no-content.ans --output create-error-no-content.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created

Error: --name with several files

Input:

$ gh issue artifact create 142 signin-plan.md oauth-research.md --name Plan

Output:

Source & reproduction
printf '--name can only be used when creating one artifact
' > create-error-name-with-several-files.ans
freeze create-error-name-with-several-files.ans --output create-error-name-with-several-files.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360

Error: files and --body together

Input:

$ gh issue artifact create 142 signin-plan.md --name Plan --body 'More text'

Output:

Source & reproduction
printf 'specify files or one of --body and --body-file, not both
' > create-error-files-and-body.ans
freeze create-error-files-and-body.ans --output create-error-files-and-body.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360

Error: --type with a link

Input:

$ gh issue artifact create 142 https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook --type plan

Output:

Source & reproduction
printf '--type only applies to documents; links are created from URLs and .url files
' > create-error-type-with-link.ans
freeze create-error-type-with-link.ans --output create-error-type-with-link.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created

Error: unreadable .url file

Input:

$ printf 'https://github.com/monalisa/monas-cafe/wiki/OAuth-runbook\n' > broken.url

Input:

$ gh issue artifact create 142 broken.url

Output:

Source & reproduction
printf 'broken.url: no [InternetShortcut] section; pass the URL as an argument instead
' > create-error-invalid-url-file.ans
freeze create-error-invalid-url-file.ans --output create-error-invalid-url-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created

Error: binary file

Input:

$ gh issue artifact create 142 signin-plan.md signin-flow.png

Output:

Source & reproduction
printf 'failed to create artifact from signin-flow.png: binary file not supported
' > create-error-binary-file.ans
freeze create-error-binary-file.ans --output create-error-binary-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created, including one for signin-plan.md

Error: empty file

Input:

$ printf '\n  \n' > empty.md && gh issue artifact create 142 signin-plan.md empty.md

Output:

Source & reproduction
printf 'failed to create artifact from empty.md: file is empty
' > create-error-empty-file.ans
freeze create-error-empty-file.ans --output create-error-empty-file.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created, including one for signin-plan.md

A file over the server's size limit

Input:

$ gh issue artifact create 142 signin-plan.md order-sync.log

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
\033[0;31mX\033[0m Failed to create artifact from {{file_name:order-sync.log}}: {{body_text:artifact body exceeds the size limit}}
' > create-too-large.ans
freeze create-too-large.ans --output create-too-large.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • The "signin-plan.md" artifact was created, and no artifact exists for order-sync.log

Error: no write access

Input:

$ gh issue artifact create 142 signin-plan.md

Output:

Source & reproduction
printf '\033[0;31mX\033[0m Failed to create artifact from {{file_name:signin-plan.md}}: Not Found
' > create-error-no-write-access.ans
freeze create-error-no-write-access.ans --output create-error-no-write-access.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • No artifact was created

A symlinked file

Input:

$ mkdir -p docs && printf '# Sign-in plan\n' > outside.md && ln -sf ../outside.md docs/signin-plan.md

Input:

$ gh issue artifact create 142 docs/signin-plan.md

Output:

Source & reproduction
printf '\033[0;32m✓\033[0m Created artifact {{number:6}} ({{artifact_name:signin-plan.md}}) on {{repo_ref:monalisa/monas-cafe#142}}
' > create-from-symlink.ans
freeze create-from-symlink.ans --output create-from-symlink.png --language ansi --font.family 'JetBrains Mono,SF Mono,Menlo,monospace' --font.size 12 --line-height 1.4 --window --padding '20,40,20,20' --background '#2b3037' --margin 20 --shadow.blur 6 --border.radius 8 --width 1360
Expected effects
  • A new generic artifact named "signin-plan.md" exists on the issue
  • The artifact body is exactly the contents of outside.md

Activity

  1. github-actions commented on Sep 25, 2026

    @github-actions
  2. cli-triage commented on Sep 25, 2026

    @cli-triage

    Thanks for the detailed design doc! This is a very thorough design spec (help text, scenarios, and error-message mockups) for a new gh issue artifact create command, so it already carries the enhancement and gh-issue labels, which look correct and complete — no additional labels needed from me.

    Duplicate check: No exact duplicate found. #14194 ("Feature: upload/download file attachments when create/update GitHub issue") requests similar underlying capability (attaching files to issues) but is a much less specific, general request without a concrete command design, so I'd call it related rather than a duplicate — worth cross-referencing but not closing this one against it.

    Given the level of detail already provided (exact CLI invocations, expected output, and error scenarios), this looks ready for engineering/design review as-is.

    Generated by Issue Triage (skills-driven) for #14525 · copilot · auto · 36.9 AIC · ⌖ 2.24 AIC · ⊞ 9.5K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-issuerelating to the gh issue command

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions