Skip to content

Commit 2b3fce4

Browse files
authored
Merge pull request #27338 from github/repo-sync
Repo sync
2 parents acca063 + 056cd70 commit 2b3fce4

File tree

3 files changed

+20
-123
lines changed

3 files changed

+20
-123
lines changed

content/actions/learn-github-actions/understanding-github-actions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ versions:
1515
type: overview
1616
topics:
1717
- Fundamentals
18+
layout: inline
1819
---
1920

2021
{% data reusables.actions.enterprise-github-hosted-runners %}

content/actions/using-workflows/about-workflows.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ redirect_from:
1313
- /actions/using-workflows/advanced-workflow-features
1414
topics:
1515
- Workflows
16+
layout: inline
1617
---
1718

1819
## About workflows

data/reusables/actions/workflow-basic-example-and-explanation.md

Lines changed: 18 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -33,149 +33,44 @@ Your new {% data variables.product.prodname_actions %} workflow file is now inst
3333
3434
To help you understand how YAML syntax is used to create a workflow file, this section explains each line of the introduction's example:
3535
36-
<table>
37-
<tr>
38-
<th scope="col">Code</th>
39-
<th scope="col">Explanation</th>
40-
</tr>
41-
<tr>
42-
<td>
43-
44-
```yaml
45-
name: learn-github-actions
46-
```
47-
48-
</td>
49-
<td>
50-
<em>Optional</em> - The name of the workflow as it will appear in the "Actions" tab of the {% data variables.product.prodname_dotcom %} repository.
51-
</td>
52-
</tr>
53-
{%- ifversion actions-run-name %}
54-
<tr>
55-
<td>
36+
```yaml annotate copy
37+
# Optional - The name of the workflow as it will appear in the "Actions" tab of the {% data variables.product.prodname_dotcom %} repository. If this field is omitted, the name of the workflow file will be used instead.
38+
name: learn-github-actions
5639

57-
```yaml
58-
run-name: {% raw %}${{ github.actor }}{% endraw %} is learning GitHub Actions
59-
```
40+
{%- ifversion actions-run-name %}
41+
# Optional - The name for workflow runs generated from the workflow, which will appear in the list of workflow runs on your repository's "Actions" tab. This example uses an expression with the `github` context to display the username of the actor that triggered the workflow run. For more information, see "[AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#run-name)."
42+
run-name: {% raw %}${{ github.actor }}{% endraw %} is learning GitHub Actions
43+
{%- endif %}
6044

61-
</td>
62-
<td>
45+
# Specifies the trigger for this workflow. This example uses the `push` event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request. This is triggered by a push to every branch; for examples of syntax that runs only on pushes to specific branches, paths, or tags, see "[AUTOTITLE](/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)."
46+
on: [push]
6347

64-
<em>Optional</em> - The name for workflow runs generated from the workflow, which will appear in the list of workflow runs on your repository's "Actions" tab. This example uses an expression with the `github` context to display the username of the actor that triggered the workflow run. For more information, see "[AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#run-name)."
65-
</td>
66-
</tr>
67-
{%- endif %}
68-
<tr>
69-
<td>
70-
71-
```yaml
72-
on: [push]
73-
```
74-
75-
</td>
76-
<td>
77-
Specifies the trigger for this workflow. This example uses the <code>push</code> event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request. This is triggered by a push to every branch; for examples of syntax that runs only on pushes to specific branches, paths, or tags, see "<a href="/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore">Workflow syntax for {% data variables.product.prodname_actions %}</a>."
78-
</td>
79-
</tr>
80-
<tr>
81-
<td>
82-
83-
```yaml
48+
# Groups together all the jobs that run in the `learn-github-actions` workflow.
8449
jobs:
85-
```
86-
87-
</td>
88-
<td>
89-
Groups together all the jobs that run in the <code>learn-github-actions</code> workflow.
90-
</td>
91-
</tr>
92-
<tr>
93-
<td>
9450

95-
```yaml
51+
# Defines a job named `check-bats-version`. The child keys will define properties of the job.
9652
check-bats-version:
97-
```
98-
99-
</td>
100-
<td>
101-
Defines a job named <code>check-bats-version</code>. The child keys will define properties of the job.
102-
</td>
103-
</tr>
104-
<tr>
105-
<td>
10653

107-
```yaml
54+
# Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub. For syntax examples using other runners, see "[AUTOTITLE](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)"
10855
runs-on: ubuntu-latest
109-
```
11056

111-
</td>
112-
<td>
113-
Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub. For syntax examples using other runners, see "<a href="/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on">Workflow syntax for {% data variables.product.prodname_actions %}</a>."
114-
</td>
115-
</tr>
116-
<tr>
117-
<td>
118-
119-
```yaml
57+
# Groups together all the steps that run in the `check-bats-version` job. Each item nested under this section is a separate action or shell script.
12058
steps:
121-
```
122-
123-
</td>
124-
<td>
125-
Groups together all the steps that run in the <code>check-bats-version</code> job. Each item nested under this section is a separate action or shell script.
126-
</td>
127-
</tr>
128-
<tr>
129-
<td>
13059

131-
```yaml
60+
# The `uses` keyword specifies that this step will run `v3` of the `actions/checkout` action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will use the repository's code.
13261
- uses: {% data reusables.actions.action-checkout %}
133-
```
134-
135-
</td>
136-
<td>
137-
The <code>uses</code> keyword specifies that this step will run <code>v3</code> of the <code>actions/checkout</code> action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will run against the repository's code.
138-
</td>
139-
</tr>
140-
<tr>
141-
<td>
14262

143-
```yaml
63+
# This step uses the `{% data reusables.actions.action-setup-node %}` action to install the specified version of the Node.js. (This example uses version 14.) This puts both the `node` and `npm` commands in your `PATH`.
14464
- uses: {% data reusables.actions.action-setup-node %}
14565
with:
14666
node-version: '14'
147-
```
14867

149-
</td>
150-
<td>
151-
This step uses the <code>{% data reusables.actions.action-setup-node %}</code> action to install the specified version of the Node.js (this example uses v14). This puts both the <code>node</code> and <code>npm</code> commands in your <code>PATH</code>.
152-
</td>
153-
</tr>
154-
<tr>
155-
<td>
156-
157-
```yaml
68+
# The `run` keyword tells the job to execute a command on the runner. In this case, you are using `npm` to install the `bats` software testing package.
15869
- run: npm install -g bats
159-
```
160-
161-
</td>
162-
<td>
163-
The <code>run</code> keyword tells the job to execute a command on the runner. In this case, you are using <code>npm</code> to install the <code>bats</code> software testing package.
164-
</td>
165-
</tr>
166-
<tr>
167-
<td>
16870

169-
```yaml
71+
# Finally, you'll run the `bats` command with a parameter that outputs the software version.
17072
- run: bats -v
171-
```
172-
173-
</td>
174-
<td>
175-
Finally, you'll run the <code>bats</code> command with a parameter that outputs the software version.
176-
</td>
177-
</tr>
178-
</table>
73+
```
17974
18075
### Visualizing the workflow file
18176

0 commit comments

Comments
 (0)