Skip to content

Commit 1e31de5

Browse files
committed
Update docs
1 parent 3df4ab1 commit 1e31de5

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Build and Test](https://github.com/actions/checkout/actions/workflows/test.yml/badge.svg)](https://github.com/actions/checkout/actions/workflows/test.yml)
22

3-
# Checkout V3
3+
# Checkout V4
44

55
This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.
66

@@ -12,14 +12,14 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
1212

1313
# What's new
1414

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.
1717

1818
# Usage
1919

2020
<!-- start usage -->
2121
```yaml
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
with:
2424
# Repository name with owner. For example, actions/checkout
2525
# 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
139139
## Fetch only the root files
140140

141141
```yaml
142-
- uses: actions/checkout@v3
142+
- uses: actions/checkout@v4
143143
with:
144144
sparse-checkout: .
145145
```
146146

147147
## Fetch only the root files and `.github` and `src` folder
148148

149149
```yaml
150-
- uses: actions/checkout@v3
150+
- uses: actions/checkout@v4
151151
with:
152152
sparse-checkout: |
153153
.github
@@ -157,7 +157,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
157157
## Fetch only a single file
158158

159159
```yaml
160-
- uses: actions/checkout@v3
160+
- uses: actions/checkout@v4
161161
with:
162162
sparse-checkout: |
163163
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
167167
## Fetch all history for all tags and branches
168168

169169
```yaml
170-
- uses: actions/checkout@v3
170+
- uses: actions/checkout@v4
171171
with:
172172
fetch-depth: 0
173173
```
174174

175175
## Checkout a different branch
176176

177177
```yaml
178-
- uses: actions/checkout@v3
178+
- uses: actions/checkout@v4
179179
with:
180180
ref: my-branch
181181
```
182182

183183
## Checkout HEAD^
184184

185185
```yaml
186-
- uses: actions/checkout@v3
186+
- uses: actions/checkout@v4
187187
with:
188188
fetch-depth: 2
189189
- 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
193193

194194
```yaml
195195
- name: Checkout
196-
uses: actions/checkout@v3
196+
uses: actions/checkout@v4
197197
with:
198198
path: main
199199
200200
- name: Checkout tools repo
201-
uses: actions/checkout@v3
201+
uses: actions/checkout@v4
202202
with:
203203
repository: my-org/my-tools
204204
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
209209

210210
```yaml
211211
- name: Checkout
212-
uses: actions/checkout@v3
212+
uses: actions/checkout@v4
213213
214214
- name: Checkout tools repo
215-
uses: actions/checkout@v3
215+
uses: actions/checkout@v4
216216
with:
217217
repository: my-org/my-tools
218218
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
223223

224224
```yaml
225225
- name: Checkout
226-
uses: actions/checkout@v3
226+
uses: actions/checkout@v4
227227
with:
228228
path: main
229229
230230
- name: Checkout private tools
231-
uses: actions/checkout@v3
231+
uses: actions/checkout@v4
232232
with:
233233
repository: my-org/my-private-tools
234234
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
241241
## Checkout pull request HEAD commit instead of merge commit
242242

243243
```yaml
244-
- uses: actions/checkout@v3
244+
- uses: actions/checkout@v4
245245
with:
246246
ref: ${{ github.event.pull_request.head.sha }}
247247
```
@@ -257,7 +257,7 @@ jobs:
257257
build:
258258
runs-on: ubuntu-latest
259259
steps:
260-
- uses: actions/checkout@v3
260+
- uses: actions/checkout@v4
261261
```
262262

263263
## Push a commit using the built-in token
@@ -268,7 +268,7 @@ jobs:
268268
build:
269269
runs-on: ubuntu-latest
270270
steps:
271-
- uses: actions/checkout@v3
271+
- uses: actions/checkout@v4
272272
- run: |
273273
date > generated.txt
274274
git config user.name github-actions

src/misc/generate-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function updateUsage(
120120
}
121121

122122
updateUsage(
123-
'actions/checkout@v3',
123+
'actions/checkout@v4',
124124
path.join(__dirname, '..', '..', 'action.yml'),
125125
path.join(__dirname, '..', '..', 'README.md')
126126
)

0 commit comments

Comments
 (0)