-
Notifications
You must be signed in to change notification settings - Fork 65.9k
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
As an example, look at https://docs.github.com/en/rest/code-scanning/code-scanning?apiVersion=2022-11-28#get-a-code-scanning-alert
What changes are you suggesting?
The code sample with GitHub CLI selected looks like:
The content is copyable, but unfortunately will not work without replacing OWNER and REPO with concrete values. However, since cli/cli#3536, the GitHub CLI understands the standard path parameter replacement syntax of {owner} and {repo} (as well as {branch}) and replaces them with the current repository if the current working directory is a clone of a GitHub repository.
You can see that they are actually used already in the API path just above (GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}).
Making this change would allow clicking the copy button, pasting directory into your terminal and hitting enter to run.
Additional information
No response