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
+20-19
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[](https://github.com/actions/checkout/actions/workflows/test.yml)
2
2
3
-
# Checkout V3
3
+
# Checkout V4
4
4
5
5
This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.
6
6
@@ -12,14 +12,15 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
12
12
13
13
# What's new
14
14
15
-
- Updated to the node16 runtime by default
16
-
- This requires a minimum [Actions Runner](https://github.com/actions/runner/releases/tag/v2.285.0) version of v2.285.0 to run, which is by default available in GHES 3.4 or later.
15
+
- Updated default runtime to node20
16
+
- This requires a minimum Actions Runner version of [v2.308.0](https://github.com/actions/runner/releases/tag/v2.308.0).
17
+
- Added support for fetching without the `--progress` option
17
18
18
19
# Usage
19
20
20
21
<!-- start usage -->
21
22
```yaml
22
-
- uses: actions/checkout@v3
23
+
- uses: actions/checkout@v4
23
24
with:
24
25
# Repository name with owner. For example, actions/checkout
25
26
# Default: ${{ github.repository }}
@@ -139,15 +140,15 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
139
140
## Fetch only the root files
140
141
141
142
```yaml
142
-
- uses: actions/checkout@v3
143
+
- uses: actions/checkout@v4
143
144
with:
144
145
sparse-checkout: .
145
146
```
146
147
147
148
## Fetch only the root files and `.github` and `src` folder
148
149
149
150
```yaml
150
-
- uses: actions/checkout@v3
151
+
- uses: actions/checkout@v4
151
152
with:
152
153
sparse-checkout: |
153
154
.github
@@ -157,7 +158,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
157
158
## Fetch only a single file
158
159
159
160
```yaml
160
-
- uses: actions/checkout@v3
161
+
- uses: actions/checkout@v4
161
162
with:
162
163
sparse-checkout: |
163
164
README.md
@@ -167,23 +168,23 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
167
168
## Fetch all history for all tags and branches
168
169
169
170
```yaml
170
-
- uses: actions/checkout@v3
171
+
- uses: actions/checkout@v4
171
172
with:
172
173
fetch-depth: 0
173
174
```
174
175
175
176
## Checkout a different branch
176
177
177
178
```yaml
178
-
- uses: actions/checkout@v3
179
+
- uses: actions/checkout@v4
179
180
with:
180
181
ref: my-branch
181
182
```
182
183
183
184
## Checkout HEAD^
184
185
185
186
```yaml
186
-
- uses: actions/checkout@v3
187
+
- uses: actions/checkout@v4
187
188
with:
188
189
fetch-depth: 2
189
190
- run: git checkout HEAD^
@@ -193,12 +194,12 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
193
194
194
195
```yaml
195
196
- name: Checkout
196
-
uses: actions/checkout@v3
197
+
uses: actions/checkout@v4
197
198
with:
198
199
path: main
199
200
200
201
- name: Checkout tools repo
201
-
uses: actions/checkout@v3
202
+
uses: actions/checkout@v4
202
203
with:
203
204
repository: my-org/my-tools
204
205
path: my-tools
@@ -209,10 +210,10 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
209
210
210
211
```yaml
211
212
- name: Checkout
212
-
uses: actions/checkout@v3
213
+
uses: actions/checkout@v4
213
214
214
215
- name: Checkout tools repo
215
-
uses: actions/checkout@v3
216
+
uses: actions/checkout@v4
216
217
with:
217
218
repository: my-org/my-tools
218
219
path: my-tools
@@ -223,12 +224,12 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
223
224
224
225
```yaml
225
226
- name: Checkout
226
-
uses: actions/checkout@v3
227
+
uses: actions/checkout@v4
227
228
with:
228
229
path: main
229
230
230
231
- name: Checkout private tools
231
-
uses: actions/checkout@v3
232
+
uses: actions/checkout@v4
232
233
with:
233
234
repository: my-org/my-private-tools
234
235
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
@@ -241,7 +242,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
241
242
## Checkout pull request HEAD commit instead of merge commit
0 commit comments