Skip to content

Commit 19369b1

Browse files
authored
Merge branch 'main' into all-contributors/add-casals
2 parents d0ae579 + 604ac9b commit 19369b1

20 files changed

+217
-110
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@
295295
"doc"
296296
]
297297
},
298+
{
299+
"login": "jeffmcaffer",
300+
"name": "Jeff McAffer",
301+
"avatar_url": "https://avatars2.githubusercontent.com/u/10070956?v=4",
302+
"profile": "https://mcaffer.com",
303+
"contributions": [
304+
"doc"
305+
]
306+
},
298307
{
299308
"login": "tjenkinson",
300309
"name": "Tom Jenkinson",

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Fork using the command line:
3232
### Make your update:
3333
Make your changes to the file(s) you'd like to update. Here are some tips and tricks for [using the docs codebase](#working-in-the-githubdocs-repository).
3434
- Are you making changes to the application code? You'll need **Node.js v14** to run the site locally. See [contributing/development.md](contributing/development.md).
35-
- Are you contributing to markdown? We use [GitHub Markdown](contributing/content-markup-reference).
35+
- Are you contributing to markdown? We use [GitHub Markdown](contributing/content-markup-reference.md).
3636

3737
### Open a pull request
3838
When you're done making changes and you'd like to propose them for review, use the [pull request template](#pull-request-template) to open your PR (pull request).
@@ -63,8 +63,6 @@ Now that you're a part of the GitHub Docs community, you can keep participating
6363
- [Starting with an issue](#starting-with-an-issue)
6464
- [Labels](#labels)
6565
- [Opening a pull request](#opening-a-pull-request)
66-
- [Fork using GitHub Desktop](#fork-using-github-desktop)
67-
- [Fork using the command line](#fork-using-the-command-line)
6866
- [Working in the github/docs repository](#working-in-the-githubdocs-repository)
6967
- [Resolving merge conflicts](#resolving-merge-conflicts)
7068
- [In the GitHub user interface](#in-the-github-user-interface)
@@ -156,7 +154,7 @@ You should always review your own PR first.
156154
For content changes, make sure that you:
157155
- [ ] Confirm that the changes address every part of the content strategy plan from your issue (if there are differences, explain them).
158156
- [ ] Review the content for technical accuracy.
159-
- [ ] Review the entire pull request using the [localization checklist](contribution/localization-checklist.md).
157+
- [ ] Review the entire pull request using the [localization checklist](contributing/localization-checklist.md).
160158
- [ ] Copy-edit the changes for grammar, spelling, and adherence to the style guide.
161159
- [ ] Check new or updated Liquid statements to confirm that versioning is correct.
162160
- [ ] Check that all of your changes render correctly in staging. Remember, that lists and tables can be tricky.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ As you're using the GitHub Docs, you may find something in an article that you'd
2626

2727
If you've found a problem, you can open an issue using a [template](https://github.com/github/docs/issues/new/choose).
2828

29+
#### Solve an issue
30+
31+
If you have a solution to one of the open issues, you will need to fork the repository and submit a PR using the [template](https://github.com/github/docs/blob/main/CONTRIBUTING.md#pull-request-template) that is visible automatically in the pull request body. For more details about this process, please check out [Getting Started with Contributing](/CONTRIBUTING.md).
32+
2933
#### Join us in discussions
3034

3135
We use GitHub Discussions to talk about all sorts of topics related to documentation and this site. For example: if you'd like help troubleshooting a PR, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/github/docs/discussions).
@@ -113,6 +117,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
113117
</tr>
114118
<tr>
115119
<td align="center"><a href="https://github.com/BenJam"><img src="https://avatars2.githubusercontent.com/u/158833?v=4" width="64px;" alt=""/><br /><sub><b>Benjamin Nickolls</b></sub></a><br /><a href="https://github.com/github/docs/commits?author=BenJam" title="Documentation">📖</a></td>
120+
<td align="center"><a href="https://mcaffer.com"><img src="https://avatars2.githubusercontent.com/u/10070956?v=4" width="64px;" alt=""/><br /><sub><b>Jeff McAffer</b></sub></a><br /><a href="https://github.com/github/docs/commits?author=jeffmcaffer" title="Documentation">📖</a></td>
116121
<td align="center"><a href="https://tjenkinson.me"><img src="https://avatars0.githubusercontent.com/u/3259993?v=4" width="64px;" alt=""/><br /><sub><b>Tom Jenkinson</b></sub></a><br /><a href="https://github.com/github/docs/commits?author=tjenkinson" title="Code">💻</a></td>
117122
<td align="center"><a href="https://github.com/casals"><img src="https://avatars0.githubusercontent.com/u/785860?v=4" width="64px;" alt=""/><br /><sub><b>Arthur Casals</b></sub></a><br /><a href="#content-casals" title="Content">🖋</a> <a href="https://github.com/github/docs/commits?author=casals" title="Documentation">📖</a></td>
118123
</tr>

content/actions/guides/storing-workflow-data-as-artifacts.md

Lines changed: 95 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ versions:
1818

1919
### About workflow artifacts
2020

21-
Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow. An artifact is a file or collection of files produced during a workflow run. For example, you can use artifacts to save your build and test output after a workflow run has ended. For pushes and pull requests, {% data variables.product.product_name %} stores artifacts for 90 days. The retention period for a pull request restarts each time someone pushes a new commit to the pull request.
21+
Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow. An artifact is a file or collection of files produced during a workflow run. For example, you can use artifacts to save your build and test output after a workflow run has ended.
22+
23+
{% data reusables.github-actions.artifact-log-retention-statement %} The retention period for a pull request restarts each time someone pushes a new commit to the pull request.
2224

2325
These are some of the common artifacts that you can upload:
2426

@@ -48,89 +50,6 @@ To share data between jobs:
4850

4951
The steps of a job share the same environment on the runner machine, but run in their own individual processes. To pass data between steps in a job, you can use inputs and outputs. For more information about inputs and outputs, see "[Metadata syntax for {% data variables.product.prodname_actions %}](/articles/metadata-syntax-for-github-actions)."
5052

51-
### Passing data between jobs in a workflow
52-
53-
You can use the `upload-artifact` and `download-artifact` actions to share data between jobs in a workflow. This example workflow illustrates how to pass data between jobs in the same workflow. For more information, see the {% if currentVersion == "free-pro-team@latest" %}[actions/upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact) actions{% else %} `actions/upload-artifact` and `download-artifact` actions on {% data variables.product.product_location %}{% endif %}.
54-
55-
Jobs that are dependent on a previous job's artifacts must wait for the dependent job to complete successfully. This workflow uses the `needs` keyword to ensure that `job_1`, `job_2`, and `job_3` run sequentially. For example, `job_2` requires `job_1` using the `needs: job_1` syntax.
56-
57-
Job 1 performs these steps:
58-
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
59-
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the name `homework`. The action places the file in a directory named `homework`.
60-
61-
Job 2 uses the result in the previous job:
62-
- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
63-
- Reads the value in the `homework/math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt`.
64-
- Uploads the `math-homework.txt` file. This upload overwrites the previous upload because both of the uploads share the same name.
65-
66-
Job 3 displays the result uploaded in the previous job:
67-
- Downloads the `homework` artifact.
68-
- Prints the result of the math equation to the log.
69-
70-
The full math operation performed in this workflow example is `(3 + 7) x 9 = 90`.
71-
72-
```yaml
73-
name: Share data between jobs
74-
75-
on: [push]
76-
77-
jobs:
78-
job_1:
79-
name: Add 3 and 7
80-
runs-on: ubuntu-latest
81-
steps:
82-
- shell: bash
83-
run: |
84-
expr 3 + 7 > math-homework.txt
85-
- name: Upload math result for job 1
86-
uses: actions/upload-artifact@v2
87-
with:
88-
name: homework
89-
path: math-homework.txt
90-
91-
job_2:
92-
name: Multiply by 9
93-
needs: job_1
94-
runs-on: windows-latest
95-
steps:
96-
- name: Download math result for job 1
97-
uses: actions/download-artifact@v2
98-
with:
99-
name: homework
100-
- shell: bash
101-
run: |
102-
value=`cat math-homework.txt`
103-
expr $value \* 9 > math-homework.txt
104-
- name: Upload math result for job 2
105-
uses: actions/upload-artifact@v2
106-
with:
107-
name: homework
108-
path: math-homework.txt
109-
110-
job_3:
111-
name: Display results
112-
needs: job_2
113-
runs-on: macOS-latest
114-
steps:
115-
- name: Download math result for job 2
116-
uses: actions/download-artifact@v2
117-
with:
118-
name: homework
119-
- name: Print the final result
120-
shell: bash
121-
run: |
122-
value=`cat math-homework.txt`
123-
echo The result is $value
124-
```
125-
126-
![Workflow that passes data between jobs to perform math](/assets/images/help/repository/passing-data-between-jobs-in-a-workflow.png)
127-
128-
### Sharing data between workflow runs
129-
130-
After a workflow ends, you can download a compressed file of the uploaded artifacts on {% data variables.product.product_name %} by finding the workflow run in the **Actions** tab. You can also use the {% data variables.product.prodname_dotcom %} REST API to download artifacts. For more information, see "[Artifacts](/v3/actions/artifacts/)."
131-
132-
If you need to access artifacts from a previous workflow run, you can use the {% data variables.product.product_name %} REST API to retrieve artifacts. For more information, see "[Get an artifact](/rest/reference/actions#artifacts)."
133-
13453
### Uploading build and test artifacts
13554

13655
You can create a continuous integration (CI) workflow to build and test your code. For more information about using {% data variables.product.prodname_actions %} to perform CI, see "[About continuous integration](/articles/about-continuous-integration)."
@@ -191,13 +110,32 @@ jobs:
191110
192111
![Image of workflow upload artifact workflow run](/assets/images/help/repository/upload-build-test-artifact.png)
193112
113+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
114+
### Configuring a custom artifact retention period
115+
116+
You can define a custom retention period for individual artifacts created by a workflow. When using a workflow to create a new artifact, you can use `retention-days` with the `upload-artifact` action. This example demonstrates how to set a custom retention period of 5 days for the artifact named `my-artifact`:
117+
118+
```
119+
- name: 'Upload Artifact'
120+
uses: actions/upload-artifact@v2
121+
with:
122+
name: my-artifact
123+
path: my_file.txt
124+
retention-days: 5
125+
```
126+
127+
The `retention-days` value cannot exceed the retention limit set by the repository, organization, or enterprise.
128+
{% endif %}
129+
194130
### Downloading or deleting artifacts
195131
196-
During a workflow run, you can download artifacts that were previously uploaded in the same workflow run. After a workflow run has been completed, you can download or delete artifacts on GitHub using the workflow run history.
132+
During a workflow run, you can use the [`download-artifact`](https://github.com/actions/download-artifact)action to download artifacts that were previously uploaded in the same workflow run.
133+
134+
After a workflow run has been completed, you can download or delete artifacts on {% data variables.product.prodname_dotcom %} or using the REST API. For more information, see "[Downloading workflow artifacts](/actions/managing-workflow-runs/downloading-workflow-artifacts)," "[Removing workflow artifacts](/actions/managing-workflow-runs/removing-workflow-artifacts)," and the "[Artifacts REST API](/v3/actions/artifacts/)."
197135
198136
#### Downloading artifacts during a workflow run
199137
200-
The [actions/download-artifact](https://github.com/actions/download-artifact) action can be used to download previously uploaded artifacts during a workflow run.
138+
The [`actions/download-artifact`](https://github.com/actions/download-artifact) action can be used to download previously uploaded artifacts during a workflow run.
201139
202140
{% note %}
203141
@@ -225,24 +163,82 @@ If you download all a workflow run's artifacts, a directory for each artifact is
225163
226164
For more information on syntax, see the {% if currentVersion == "free-pro-team@latest" %}[actions/download-artifact](https://github.com/actions/download-artifact) action{% else %} `actions/download-artifact` action on {% data variables.product.product_location %}{% endif %}.
227165

228-
#### Downloading and deleting artifacts after a workflow run is complete
166+
### Passing data between jobs in a workflow
167+
168+
You can use the `upload-artifact` and `download-artifact` actions to share data between jobs in a workflow. This example workflow illustrates how to pass data between jobs in the same workflow. For more information, see the {% if currentVersion == "free-pro-team@latest" %}[actions/upload-artifact](https://github.com/actions/upload-artifact) and [download-artifact](https://github.com/actions/download-artifact) actions{% else %} `actions/upload-artifact` and `download-artifact` actions on {% data variables.product.product_location %}{% endif %}.
169+
170+
Jobs that are dependent on a previous job's artifacts must wait for the dependent job to complete successfully. This workflow uses the `needs` keyword to ensure that `job_1`, `job_2`, and `job_3` run sequentially. For example, `job_2` requires `job_1` using the `needs: job_1` syntax.
171+
172+
Job 1 performs these steps:
173+
- Performs a math calculation and saves the result to a text file called `math-homework.txt`.
174+
- Uses the `upload-artifact` action to upload the `math-homework.txt` file with the name `homework`. The action places the file in a directory named `homework`.
175+
176+
Job 2 uses the result in the previous job:
177+
- Downloads the `homework` artifact uploaded in the previous job. By default, the `download-artifact` action downloads artifacts to the workspace directory that the step is executing in. You can use the `path` input parameter to specify a different download directory.
178+
- Reads the value in the `homework/math-homework.txt` file, performs a math calculation, and saves the result to `math-homework.txt`.
179+
- Uploads the `math-homework.txt` file. This upload overwrites the previous upload because both of the uploads share the same name.
180+
181+
Job 3 displays the result uploaded in the previous job:
182+
- Downloads the `homework` artifact.
183+
- Prints the result of the math equation to the log.
184+
185+
The full math operation performed in this workflow example is `(3 + 7) x 9 = 90`.
186+
187+
```yaml
188+
name: Share data between jobs
229189
230-
Artifacts automatically expire after 90 days, but you can always reclaim used {% data variables.product.prodname_actions %} storage by deleting artifacts before they expire on {% data variables.product.product_name %}.
190+
on: [push]
231191
232-
{% warning %}
192+
jobs:
193+
job_1:
194+
name: Add 3 and 7
195+
runs-on: ubuntu-latest
196+
steps:
197+
- shell: bash
198+
run: |
199+
expr 3 + 7 > math-homework.txt
200+
- name: Upload math result for job 1
201+
uses: actions/upload-artifact@v2
202+
with:
203+
name: homework
204+
path: math-homework.txt
233205
234-
**Warning:** Once you delete an artifact, it can not be restored.
206+
job_2:
207+
name: Multiply by 9
208+
needs: job_1
209+
runs-on: windows-latest
210+
steps:
211+
- name: Download math result for job 1
212+
uses: actions/download-artifact@v2
213+
with:
214+
name: homework
215+
- shell: bash
216+
run: |
217+
value=`cat math-homework.txt`
218+
expr $value \* 9 > math-homework.txt
219+
- name: Upload math result for job 2
220+
uses: actions/upload-artifact@v2
221+
with:
222+
name: homework
223+
path: math-homework.txt
235224

236-
{% endwarning %}
225+
job_3:
226+
name: Display results
227+
needs: job_2
228+
runs-on: macOS-latest
229+
steps:
230+
- name: Download math result for job 2
231+
uses: actions/download-artifact@v2
232+
with:
233+
name: homework
234+
- name: Print the final result
235+
shell: bash
236+
run: |
237+
value=`cat math-homework.txt`
238+
echo The result is $value
239+
```
237240
238-
{% data reusables.repositories.navigate-to-repo %}
239-
{% data reusables.repositories.actions-tab %}
240-
{% data reusables.repositories.navigate-to-workflow %}
241-
{% data reusables.repositories.view-run %}
242-
1. To download artifacts, use the **Artifacts** drop-down menu, and select the artifact you want to download.
243-
![Download artifact drop-down menu](/assets/images/help/repository/artifact-drop-down.png)
244-
1. To delete artifacts, use the **Artifacts** drop-down menu, and click {% octicon "trashcan" aria-label="The trashcan icon" %}.
245-
![Delete artifact drop-down menu](/assets/images/help/repository/actions-delete-artifact.png)
241+
![Workflow that passes data between jobs to perform math](/assets/images/help/repository/passing-data-between-jobs-in-a-workflow.png)
246242
247243
{% if currentVersion == "free-pro-team@latest" %}
248244

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Downloading workflow artifacts
3-
intro: You can download artifacts that were archived during a workflow run. Artifacts automatically expire after 90 days.
3+
intro: You can download archived artifacts before they automatically expire.
44
product: '{% data reusables.gated-features.actions %}'
55
versions:
66
free-pro-team: '*'
@@ -10,6 +10,9 @@ versions:
1010
{% data reusables.actions.enterprise-beta %}
1111
{% data reusables.actions.enterprise-github-hosted-runners %}
1212

13+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %} 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 %}
14+
{% if currentVersion == "enterprise-server@2.22" %} {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.{% endif %}
15+
1316
{% data reusables.repositories.permissions-statement-read %}
1417

1518
{% data reusables.repositories.navigate-to-repo %}

0 commit comments

Comments
 (0)