Skip to content

Commit 4b5cfca

Browse files
Sarah Edwardsmegbird
andauthored
Add CLI content to handul of articles (github#19810)
* move workflow disable content to tool selector * add cli tab to workflow articles * seeing if this works * add reusable * update for each platform * update with flags * update with product switchers * update with end tag * add cli tab * update with cli and desktop tabs * add desktop and cli tabs * remove tip * get tests passing * last small updates * fix break * remove break maybe * update with download link reusable * update with download resuable * resolve feedback * quotes around string * flesh this out a bit more * remove reusable * update with more feedback Co-authored-by: Meg Bird <megbird@github.com>
1 parent af158bc commit 4b5cfca

File tree

11 files changed

+319
-89
lines changed

11 files changed

+319
-89
lines changed

content/actions/managing-workflow-runs/disabling-and-enabling-a-workflow.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ Temporarily disabling a workflow can be useful in many scenarios. These are a fe
2828

2929
{% endwarning %}
3030

31-
## Disabling and enabling workflows with the {% data variables.product.prodname_dotcom %} UI
31+
You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
3232

3333
### Disabling a workflow
3434

35-
You can manually disable a workflow so that it won't execute any workflow runs. A disabled workflow is not deleted, and can be re-enabled.
35+
{% include tool-switcher %}
36+
37+
{% webui %}
3638

3739
{% data reusables.repositories.navigate-to-repo %}
3840
{% data reusables.repositories.actions-tab %}
@@ -45,8 +47,28 @@ You can manually disable a workflow so that it won't execute any workflow runs.
4547
The disabled workflow is marked {% octicon "stop" aria-label="The stop icon" %} to indicate its status.
4648
![actions list disabled workflow](/assets/images/help/repository/actions-find-disabled-workflow.png)
4749

50+
{% endwebui %}
51+
52+
{% cli %}
53+
54+
{% data reusables.cli.download-cli %}
55+
56+
{% data reusables.actions.actions-cli %}
57+
58+
To disable a workflow, use the `workflow disable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to disable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
59+
60+
```shell
61+
gh workflow disable <em>workflow</em>
62+
```
63+
64+
{% endcli %}
65+
4866
### Enabling a workflow
4967

68+
{% include tool-switcher %}
69+
70+
{% webui %}
71+
5072
You can re-enable a workflow that was previously disabled.
5173

5274
{% data reusables.repositories.navigate-to-repo %}
@@ -56,22 +78,16 @@ You can re-enable a workflow that was previously disabled.
5678
1. Click **Enable workflow**.
5779
![actions enable workflow](/assets/images/help/repository/actions-enable-workflow.png)
5880

59-
## Disabling and enabling workflows with {% data variables.product.prodname_cli %}
81+
{% endwebui %}
6082

61-
{% data reusables.actions.actions-cli %}
62-
63-
To disable a workflow, use the `workflow disable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to disable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
83+
{% cli %}
6484

65-
```shell
66-
gh workflow disable <em>workflow</em>
67-
```
85+
{% data reusables.actions.actions-cli %}
6886

6987
To enable a workflow, use the `workflow enable` subcommand. Replace `workflow` with either the name, ID, or file name of the workflow you want to enable. For example, `"Link Checker"`, `1234567`, or `"link-check-test.yml"`. If you don't specify a workflow, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a workflow.
7088

7189
```shell
7290
gh workflow enable <em>workflow</em>
7391
```
7492

75-
## Disabling and enabling workflows through the REST API
76-
77-
You can also disable and enable a workflow using the REST API. For more information, see the "[Actions REST API](/rest/reference/actions#workflows)."
93+
{% endcli %}

content/actions/managing-workflow-runs/downloading-workflow-artifacts.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ shortTitle: Download workflow artifacts
1313
{% data reusables.actions.enterprise-github-hosted-runners %}
1414
{% data reusables.actions.ae-beta %}
1515

16-
{% ifversion fpt or ghes > 2.22 or ghae %} By default, {% data variables.product.product_name %} stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see "[Configuring the retention period for GitHub Actions artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)."{% endif %}
17-
{% ifversion ghes = 2.22 %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
18-
19-
## Download artifacts with the {% data variables.product.prodname_dotcom %} UI
16+
{% ifversion fpt or ghes > 2.22 or ghae %} By default, {% data variables.product.product_name %} stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see "[Configuring the retention period for GitHub Actions artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)."{% endif %}
17+
{% ifversion ghes = 2.22 %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
2018

2119
{% data reusables.repositories.permissions-statement-read %}
2220

21+
{% include tool-switcher %}
22+
23+
{% webui %}
24+
2325
{% data reusables.repositories.navigate-to-repo %}
2426
{% data reusables.repositories.actions-tab %}
2527
{% data reusables.repositories.navigate-to-workflow %}
@@ -31,7 +33,11 @@ shortTitle: Download workflow artifacts
3133
![Download artifact drop-down menu](/assets/images/help/repository/artifact-drop-down.png)
3234
{% endif %}
3335

34-
## Download artifacts with {% data variables.product.prodname_cli %}
36+
{% endwebui %}
37+
38+
{% cli %}
39+
40+
{% data reusables.cli.download-cli %}
3541

3642
{% data reusables.actions.actions-cli %}
3743

@@ -60,3 +66,5 @@ To download specific artifacts across all runs in a repository, use the `run dow
6066
```shell
6167
gh run download -n <em>artifact-name-1</em> -n <em>artifact-name-2</em>
6268
```
69+
70+
{% endcli %}

content/actions/managing-workflow-runs/manually-running-a-workflow.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ shortTitle: Manually run a workflow
1515

1616
## Configuring a workflow to run manually
1717

18-
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. For more information about configuring the `workflow_dispatch` event, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)".
18+
To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event. To trigger the `workflow_dispatch` event, your workflow must be in the default branch. For more information about configuring the `workflow_dispatch` event, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)".
1919

20-
## Running a workflow on {% data variables.product.prodname_dotcom %}
20+
{% data reusables.repositories.permissions-statement-write %}
2121

22-
To trigger the `workflow_dispatch` event on {% data variables.product.prodname_dotcom %}, your workflow must be in the default branch. Follow these steps to manually trigger a workflow run.
22+
### Running a workflow
2323

24-
{% data reusables.repositories.permissions-statement-write %}
24+
{% include tool-switcher %}
25+
26+
{% webui %}
2527

2628
{% data reusables.repositories.navigate-to-repo %}
2729
{% data reusables.repositories.actions-tab %}
@@ -32,7 +34,11 @@ To trigger the `workflow_dispatch` event on {% data variables.product.prodname_d
3234
1. Select the branch where the workflow will run and type the input parameters used by the workflow. Click **Run workflow**.
3335
![actions manually run workflow](/assets/images/actions-manually-run-workflow.png)
3436

35-
## Running a workflow using {% data variables.product.prodname_cli %}
37+
{% endwebui %}
38+
39+
{% cli %}
40+
41+
{% data reusables.cli.download-cli %}
3642

3743
{% data reusables.actions.actions-cli %}
3844

@@ -66,8 +72,10 @@ To view the progress of the workflow run, use the `run watch` subcommand and sel
6672
gh run watch
6773
```
6874

69-
## Running a workflow using the REST API
75+
{% endcli %}
76+
77+
### Running a workflow using the REST API
7078

71-
When using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.
79+
When using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.
7280

7381
For more information about using the REST API, see the "[Create a workflow dispatch event](/rest/reference/actions/#create-a-workflow-dispatch-event)."

content/actions/managing-workflow-runs/re-running-a-workflow.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,23 @@ versions:
1212
{% data reusables.actions.enterprise-github-hosted-runners %}
1313
{% data reusables.actions.ae-beta %}
1414

15-
## Re-run a workflow using the {% data variables.product.prodname_dotcom %} UI
16-
1715
{% data reusables.repositories.permissions-statement-write %}
1816

17+
{% include tool-switcher %}
18+
19+
{% webui %}
20+
1921
{% data reusables.repositories.navigate-to-repo %}
2022
{% data reusables.repositories.actions-tab %}
2123
{% data reusables.repositories.navigate-to-workflow %}
2224
{% data reusables.repositories.view-run %}
2325
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.{% ifversion fpt or ghes > 3.0 or ghae %}![Re-run checks drop-down menu](/assets/images/help/repository/rerun-checks-drop-down-updated.png){% else %}![Re-run checks drop-down menu](/assets/images/help/repository/rerun-checks-drop-down.png){% endif %}
2426

25-
## Re-run a workflow using {% data variables.product.prodname_cli %}
27+
{% endwebui %}
28+
29+
{% cli %}
30+
31+
{% data reusables.cli.download-cli %}
2632

2733
{% data reusables.actions.actions-cli %}
2834

@@ -37,3 +43,5 @@ To view the progress of the workflow run, use the `run watch` subcommand and sel
3743
```shell
3844
gh run watch
3945
```
46+
47+
{% endcli %}

content/actions/managing-workflow-runs/viewing-workflow-run-history.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ shortTitle: View workflow run history
1313
{% data reusables.actions.enterprise-github-hosted-runners %}
1414
{% data reusables.actions.ae-beta %}
1515

16-
## Viewing workflow run history on {% data variables.product.prodname_dotcom %}
17-
1816
{% data reusables.repositories.permissions-statement-read %}
1917

18+
{% include tool-switcher %}
19+
20+
{% webui %}
21+
2022
{% data reusables.repositories.navigate-to-repo %}
2123
{% data reusables.repositories.actions-tab %}
2224
{% data reusables.repositories.navigate-to-workflow %}
2325
{% data reusables.repositories.view-run %}
2426

25-
## Viewing workflow run history with {% data variables.product.prodname_cli %}
27+
{% endwebui %}
28+
29+
{% cli %}
30+
31+
{% data reusables.cli.download-cli %}
2632

2733
{% data reusables.actions.actions-cli %}
2834

@@ -77,3 +83,5 @@ Use the `--exit-status` flag to exit with a non-zero status if the run failed. F
7783
```shell
7884
gh run view 0451 --exit-status && echo "run pending or passed"
7985
```
86+
87+
{% endcli %}

content/get-started/quickstart/fork-a-repo.md

Lines changed: 79 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,50 @@ When creating your public repository from a fork of someone's project, make sure
4343

4444
{% endif %}
4545

46-
{% note %}
46+
## Prerequisties
4747

48-
**Note**: {% data reusables.repositories.desktop-fork %}
49-
50-
{% endnote %}
51-
52-
{% ifversion fpt or ghes or ghae %}
53-
{% tip %}
54-
55-
**Tip**: You can also fork a repository using the {% data variables.product.prodname_cli %}. For more information, see "[`gh repo fork`](https://cli.github.com/manual/gh_repo_fork)" in the {% data variables.product.prodname_cli %} documentation.
48+
If you haven't yet, you should first [set up Git](/articles/set-up-git). Don't forget to [set up authentication to {% data variables.product.product_location %} from Git](/articles/set-up-git#next-steps-authenticating-with-github-from-git) as well.
5649

57-
{% endtip %}
58-
{% endif %}
50+
## Forking a repository
5951

60-
## Fork an example repository
52+
{% include tool-switcher %}
53+
{% webui %}
6154

62-
Forking a repository is a simple two-step process. We've created a repository for you to practice with.
55+
You might fork a project to propose changes to the upstream, or original, repository. In this case, it's good practice to regularly sync your fork with the upstream repository. To do this, you'll need to use Git on the command line. You can practice setting the upstream repository using the same [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository you just forked.
6356

6457
1. On {% data variables.product.product_location %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
6558
2. In the top-right corner of the page, click **Fork**.
6659
![Fork button](/assets/images/help/repository/fork_button.jpg)
6760

68-
## Keep your fork synced
61+
{% endwebui %}
6962

70-
You might fork a project to propose changes to the upstream, or original, repository. In this case, it's good practice to regularly sync your fork with the upstream repository. To do this, you'll need to use Git on the command line. You can practice setting the upstream repository using the same [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository you just forked.
63+
{% cli %}
7164

72-
### Step 1: Set up Git
65+
{% data reusables.cli.download-cli %}
7366

74-
If you haven't yet, you should first [set up Git](/articles/set-up-git). Don't forget to [set up authentication to {% data variables.product.product_location %} from Git](/articles/set-up-git#next-steps-authenticating-with-github-from-git) as well.
67+
To create a fork of a repository, use the `gh repo fork` subcommand.
7568

76-
### Step 2: Create a local clone of your fork
69+
```shell
70+
gh repo fork <em>repository</em>
71+
```
7772

78-
Right now, you have a fork of the Spoon-Knife repository, but you don't have the files in that repository on your computer. Let's create a clone of your fork locally on your computer.
73+
To create the fork in an organization, use the `--org` flag.
74+
75+
```shell
76+
gh repo fork <em>repository</em> --org "octo-org"
77+
```
78+
79+
{% endcli %}
80+
81+
{% desktop %}
82+
{% enddesktop %}
83+
84+
## Cloning your forked repository
85+
86+
Right now, you have a fork of the Spoon-Knife repository, but you don't have the files in that repository locally your computer.
87+
88+
{% include tool-switcher %}
89+
{% webui %}
7990

8091
1. On {% data variables.product.product_name %}, navigate to **your fork** of the Spoon-Knife repository.
8192
{% data reusables.repositories.copy-clone-url %}
@@ -95,16 +106,42 @@ Right now, you have a fork of the Spoon-Knife repository, but you don't have the
95106
> remove: Total 10 (delta 1), reused 10 (delta 1)
96107
> Unpacking objects: 100% (10/10), done.
97108
```
98-
Now, you have a local copy of your fork of the Spoon-Knife repository.
99109

100-
### Step 3: Configure Git to sync your fork with the original Spoon-Knife repository
110+
{% endwebui %}
111+
112+
{% cli %}
113+
114+
{% data reusables.cli.download-cli %}
115+
116+
To create a clone of your fork, use the `--clone` flag.
117+
118+
```shell
119+
gh repo fork <em>repository</em> --clone=true
120+
```
121+
122+
{% endcli %}
123+
124+
{% desktop %}
125+
126+
{% data reusables.desktop.choose-clone-repository %}
127+
{% data reusables.desktop.cloning-location-tab %}
128+
{% data reusables.desktop.cloning-repository-list %}
129+
{% data reusables.desktop.choose-local-path %}
130+
{% data reusables.desktop.click-clone %}
131+
132+
{% enddesktop %}
133+
134+
## Configuring Git to sync your fork with the original repository
101135

102136
When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.
103137

138+
{% include tool-switcher %}
139+
{% webui %}
140+
104141
1. On {% data variables.product.product_name %}, navigate to the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository.
105142
{% data reusables.repositories.copy-clone-url %}
106143
{% data reusables.command_line.open_the_multi_os_terminal %}
107-
4. Change directories to the location of the fork you cloned in [Step 2: Create a local clone of your fork](#step-2-create-a-local-clone-of-your-fork).
144+
4. Change directories to the location of the fork you cloned.
108145
- To go to your home directory, type just `cd` with no other text.
109146
- To list the files and folders in your current directory, type `ls`.
110147
- To go into one of your listed directories, type `cd your_listed_directory`.
@@ -132,6 +169,26 @@ When you fork a project in order to propose changes to the original repository,
132169

133170
Now, you can keep your fork synced with the upstream repository with a few Git commands. For more information, see "[Syncing a fork](/articles/syncing-a-fork)."
134171

172+
{% endwebui %}
173+
174+
{% cli %}
175+
176+
{% data reusables.cli.download-cli %}
177+
178+
To configure a remote repository for the forked repository, use the `--remote` flag.
179+
180+
```shell
181+
gh repo fork <em>repository</em> --remote=true
182+
```
183+
184+
To specify the remote repository's name, use the `--remote-name` flag.
185+
186+
```shell
187+
gh repo fork <em>repository</em> --remote-name "main-remote-repo"
188+
```
189+
190+
{% endcli %}
191+
135192
### Next steps
136193

137194
You can make any changes to a fork, including:

0 commit comments

Comments
 (0)