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