1
1
[](https://github.com/actions/checkout/actions/workflows/test.yml)
2
2
3
+
# Checkout V5
4
+
5
+
Checkout v5 now supports Node.js 24
6
+
3
7
# Checkout V4
4
8
5
9
This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.
@@ -36,7 +40,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
36
40
37
41
<!-- start usage -->
38
42
```yaml
39
-
- uses: actions/checkout@v4
43
+
- uses: actions/checkout@v5
40
44
with:
41
45
# Repository name with owner. For example, actions/checkout
42
46
# Default: ${{ github.repository }}
@@ -149,32 +153,40 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
149
153
150
154
# Scenarios
151
155
152
-
- [Fetch only the root files](#Fetch-only-the-root-files)
153
-
- [Fetch only the root files and `.github` and `src` folder](#Fetch-only-the-root-files-and-github-and-src-folder)
154
-
- [Fetch only a single file](#Fetch-only-a-single-file)
155
-
- [Fetch all history for all tags and branches](#Fetch-all-history-for-all-tags-and-branches)
156
-
- [Checkout a different branch](#Checkout-a-different-branch)
157
-
- [Checkout HEAD^](#Checkout-HEAD)
158
-
- [Checkout multiple repos (side by side)](#Checkout-multiple-repos-side-by-side)
159
-
- [Checkout multiple repos (nested)](#Checkout-multiple-repos-nested)
160
-
- [Checkout multiple repos (private)](#Checkout-multiple-repos-private)
161
-
- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit)
162
-
- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)
163
-
- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)
164
-
- [Push a commit to a PR using the built-in token](#Push-a-commit-to-a-PR-using-the-built-in-token)
156
+
- [Checkout V5](#checkout-v5)
157
+
- [Checkout V4](#checkout-v4)
158
+
- [Note](#note)
159
+
- [What's new](#whats-new)
160
+
- [Usage](#usage)
161
+
- [Scenarios](#scenarios)
162
+
- [Fetch only the root files](#fetch-only-the-root-files)
163
+
- [Fetch only the root files and `.github` and `src` folder](#fetch-only-the-root-files-and-github-and-src-folder)
164
+
- [Fetch only a single file](#fetch-only-a-single-file)
165
+
- [Fetch all history for all tags and branches](#fetch-all-history-for-all-tags-and-branches)
166
+
- [Checkout a different branch](#checkout-a-different-branch)
167
+
- [Checkout HEAD^](#checkout-head)
168
+
- [Checkout multiple repos (side by side)](#checkout-multiple-repos-side-by-side)
169
+
- [Checkout multiple repos (nested)](#checkout-multiple-repos-nested)
170
+
- [Checkout multiple repos (private)](#checkout-multiple-repos-private)
171
+
- [Checkout pull request HEAD commit instead of merge commit](#checkout-pull-request-head-commit-instead-of-merge-commit)
172
+
- [Checkout pull request on closed event](#checkout-pull-request-on-closed-event)
173
+
- [Push a commit using the built-in token](#push-a-commit-using-the-built-in-token)
174
+
- [Push a commit to a PR using the built-in token](#push-a-commit-to-a-pr-using-the-built-in-token)
175
+
- [Recommended permissions](#recommended-permissions)
176
+
- [License](#license)
165
177
166
178
## Fetch only the root files
167
179
168
180
```yaml
169
-
- uses: actions/checkout@v4
181
+
- uses: actions/checkout@v5
170
182
with:
171
183
sparse-checkout: .
172
184
```
173
185
174
186
## Fetch only the root files and `.github` and `src` folder
175
187
176
188
```yaml
177
-
- uses: actions/checkout@v4
189
+
- uses: actions/checkout@v5
178
190
with:
179
191
sparse-checkout: |
180
192
.github
@@ -184,7 +196,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
184
196
## Fetch only a single file
185
197
186
198
```yaml
187
-
- uses: actions/checkout@v4
199
+
- uses: actions/checkout@v5
188
200
with:
189
201
sparse-checkout: |
190
202
README.md
@@ -194,23 +206,23 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
194
206
## Fetch all history for all tags and branches
195
207
196
208
```yaml
197
-
- uses: actions/checkout@v4
209
+
- uses: actions/checkout@v5
198
210
with:
199
211
fetch-depth: 0
200
212
```
201
213
202
214
## Checkout a different branch
203
215
204
216
```yaml
205
-
- uses: actions/checkout@v4
217
+
- uses: actions/checkout@v5
206
218
with:
207
219
ref: my-branch
208
220
```
209
221
210
222
## Checkout HEAD^
211
223
212
224
```yaml
213
-
- uses: actions/checkout@v4
225
+
- uses: actions/checkout@v5
214
226
with:
215
227
fetch-depth: 2
216
228
- run: git checkout HEAD^
@@ -220,12 +232,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
220
232
221
233
```yaml
222
234
- name: Checkout
223
-
uses: actions/checkout@v4
235
+
uses: actions/checkout@v5
224
236
with:
225
237
path: main
226
238
227
239
- name: Checkout tools repo
228
-
uses: actions/checkout@v4
240
+
uses: actions/checkout@v5
229
241
with:
230
242
repository: my-org/my-tools
231
243
path: my-tools
@@ -236,10 +248,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
236
248
237
249
```yaml
238
250
- name: Checkout
239
-
uses: actions/checkout@v4
251
+
uses: actions/checkout@v5
240
252
241
253
- name: Checkout tools repo
242
-
uses: actions/checkout@v4
254
+
uses: actions/checkout@v5
243
255
with:
244
256
repository: my-org/my-tools
245
257
path: my-tools
@@ -250,12 +262,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
250
262
251
263
```yaml
252
264
- name: Checkout
253
-
uses: actions/checkout@v4
265
+
uses: actions/checkout@v5
254
266
with:
255
267
path: main
256
268
257
269
- name: Checkout private tools
258
-
uses: actions/checkout@v4
270
+
uses: actions/checkout@v5
259
271
with:
260
272
repository: my-org/my-private-tools
261
273
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
@@ -268,7 +280,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
268
280
## Checkout pull request HEAD commit instead of merge commit
269
281
270
282
```yaml
271
-
- uses: actions/checkout@v4
283
+
- uses: actions/checkout@v5
272
284
with:
273
285
ref: ${{ github.event.pull_request.head.sha }}
274
286
```
@@ -284,7 +296,7 @@ jobs:
284
296
build:
285
297
runs-on: ubuntu-latest
286
298
steps:
287
-
- uses: actions/checkout@v4
299
+
- uses: actions/checkout@v5
288
300
```
289
301
290
302
## Push a commit using the built-in token
@@ -295,7 +307,7 @@ jobs:
295
307
build:
296
308
runs-on: ubuntu-latest
297
309
steps:
298
-
- uses: actions/checkout@v4
310
+
- uses: actions/checkout@v5
299
311
- run: |
300
312
date > generated.txt
301
313
# Note: the following account information will not work on GHES
@@ -317,7 +329,7 @@ jobs:
317
329
build:
318
330
runs-on: ubuntu-latest
319
331
steps:
320
-
- uses: actions/checkout@v4
332
+
- uses: actions/checkout@v5
321
333
with:
322
334
ref: ${{ github.head_ref }}
323
335
- run: |
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4