You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,10 @@ As you're using the GitHub Docs, you may find something in an article that you'd
26
26
27
27
If you've found a problem, you can open an issue using a [template](https://github.com/github/docs/issues/new/choose).
28
28
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
+
29
33
#### Join us in discussions
30
34
31
35
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).
Copy file name to clipboardExpand all lines: content/actions/guides/storing-workflow-data-as-artifacts.md
+95-99Lines changed: 95 additions & 99 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,9 @@ versions:
18
18
19
19
### About workflow artifacts
20
20
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.
22
24
23
25
These are some of the common artifacts that you can upload:
24
26
@@ -48,89 +50,6 @@ To share data between jobs:
48
50
49
51
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)."
50
52
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
-

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
-
134
53
### Uploading build and test artifacts
135
54
136
55
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:
191
110
192
111

193
112
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
+
194
130
### Downloading or deleting artifacts
195
131
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/)."
197
135
198
136
#### Downloading artifacts during a workflow run
199
137
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.
201
139
202
140
{% note %}
203
141
@@ -225,24 +163,82 @@ If you download all a workflow run's artifacts, a directory for each artifact is
225
163
226
164
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 %}.
227
165
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
229
189
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]
231
191
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
233
205
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
235
224
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
+
```
237
240
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.
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/downloading-workflow-artifacts.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.
4
4
product: '{% data reusables.gated-features.actions %}'
5
5
versions:
6
6
free-pro-team: '*'
@@ -10,6 +10,9 @@ versions:
10
10
{% data reusables.actions.enterprise-beta %}
11
11
{% data reusables.actions.enterprise-github-hosted-runners %}
12
12
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
+
13
16
{% data reusables.repositories.permissions-statement-read %}
14
17
15
18
{% data reusables.repositories.navigate-to-repo %}
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/removing-workflow-artifacts.md
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Removing workflow artifacts
3
-
intro: '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 %}.'
3
+
intro: 'You can reclaim used {% data variables.product.prodname_actions %} storage by deleting artifacts before they expire on {% data variables.product.product_name %}.'
4
4
product: '{% data reusables.gated-features.actions %}'
5
5
versions:
6
6
free-pro-team: '*'
@@ -10,6 +10,8 @@ versions:
10
10
{% data reusables.actions.enterprise-beta %}
11
11
{% data reusables.actions.enterprise-github-hosted-runners %}
12
12
13
+
### Deleting an artifact
14
+
13
15
{% warning %}
14
16
15
17
**Warning:** Once you delete an artifact, it can not be restored.
@@ -18,9 +20,23 @@ versions:
18
20
19
21
{% data reusables.repositories.permissions-statement-write %}
20
22
23
+
{% data reusables.github-actions.artifact-log-retention-statement %}
24
+
21
25
{% data reusables.repositories.navigate-to-repo %}
22
26
{% data reusables.repositories.actions-tab %}
23
27
{% data reusables.repositories.navigate-to-workflow %}
24
28
{% data reusables.repositories.view-run %}
25
29
1. Under **Artifacts**, click {% octicon "trashcan" aria-label="The trashcan icon" %} next to the artifact you want to remove.
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
33
+
### Setting the retention period for an artifact
34
+
35
+
Retention periods for artifacts and logs can be configured at the repository, organization, and enterprise level. For more information, see "[Usage limits, billing, and administration](/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy)."
36
+
37
+
You can also define a custom retention period for individual artifacts using the `actions/upload-artifact` action in a workflow. For more information, see "[Storing workflow data as artifacts](/actions/guides/storing-workflow-data-as-artifacts#configuring-a-custom-artifact-retention-period)."
38
+
39
+
### Finding the expiration date of an artifact
40
+
41
+
You can use the API to confirm the date that an artifact is scheduled to be deleted. For more information, see the `expires_at` value returned by "[List artifacts for a repository](/rest/reference/actions#artifacts)."
Copy file name to clipboardExpand all lines: content/actions/managing-workflow-runs/using-workflow-run-logs.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Using workflow run logs
3
-
intro: 'You can view, search, and download the logs for each job in a workflow run. {% data variables.product.product_name %} stores full build logs and artifacts for 90 days.'
3
+
intro: 'You can view, search, and download the logs for each job in a workflow run.'
4
4
product: '{% data reusables.gated-features.actions %}'
Copy file name to clipboardExpand all lines: content/actions/reference/usage-limits-billing-and-administration.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,20 @@ Usage limits apply to self-hosted runners. For more information, see "[About sel
53
53
In addition to the usage limits, you must ensure that you use {% data variables.product.prodname_actions %} within the [GitHub Terms of Service](/articles/github-terms-of-service/). For more information on {% data variables.product.prodname_actions %}-specific terms, see the [GitHub Additional Product Terms](/github/site-policy/github-additional-product-terms#a-actions-usage).
54
54
{% endif %}
55
55
56
+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
57
+
### Artifact and log retention policy
58
+
59
+
You can configure the artifact and log retention period for your repository, organization, or enterprise account.
60
+
61
+
{% data reusables.actions.about-artifact-log-retention %}
62
+
63
+
For more information, see:
64
+
65
+
-[Configuring the retention period for {% data variables.product.prodname_actions %} for artifacts and logs in your repository](/github/administering-a-repository/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)
66
+
-[Configuring the retention period for {% data variables.product.prodname_actions %} for artifacts and logs in your organization](/github/setting-up-and-managing-organizations-and-teams/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization)
67
+
-[Configuring the retention period for {% data variables.product.prodname_actions %} for artifacts and logs in your enterprise](/github/setting-up-and-managing-your-enterprise-account/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-enterprise-account)
68
+
{% endif %}
69
+
56
70
### Disabling or limiting {% data variables.product.prodname_actions %} for your repository or organization
57
71
58
72
{% data reusables.github-actions.disabling-github-actions %}
0 commit comments