Skip to content

Commit 72f2cec

Browse files
authored
Update README.md for V4 (#1452)
* Update README.md for V4 * Update actionReference in generate-docs.ts for v4
1 parent 3df4ab1 commit 72f2cec

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

README.md

+20-19
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,15 @@ 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 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
1718

1819
# Usage
1920

2021
<!-- start usage -->
2122
```yaml
22-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2324
with:
2425
# Repository name with owner. For example, actions/checkout
2526
# 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
139140
## Fetch only the root files
140141

141142
```yaml
142-
- uses: actions/checkout@v3
143+
- uses: actions/checkout@v4
143144
with:
144145
sparse-checkout: .
145146
```
146147

147148
## Fetch only the root files and `.github` and `src` folder
148149

149150
```yaml
150-
- uses: actions/checkout@v3
151+
- uses: actions/checkout@v4
151152
with:
152153
sparse-checkout: |
153154
.github
@@ -157,7 +158,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
157158
## Fetch only a single file
158159

159160
```yaml
160-
- uses: actions/checkout@v3
161+
- uses: actions/checkout@v4
161162
with:
162163
sparse-checkout: |
163164
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
167168
## Fetch all history for all tags and branches
168169

169170
```yaml
170-
- uses: actions/checkout@v3
171+
- uses: actions/checkout@v4
171172
with:
172173
fetch-depth: 0
173174
```
174175

175176
## Checkout a different branch
176177

177178
```yaml
178-
- uses: actions/checkout@v3
179+
- uses: actions/checkout@v4
179180
with:
180181
ref: my-branch
181182
```
182183

183184
## Checkout HEAD^
184185

185186
```yaml
186-
- uses: actions/checkout@v3
187+
- uses: actions/checkout@v4
187188
with:
188189
fetch-depth: 2
189190
- 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
193194

194195
```yaml
195196
- name: Checkout
196-
uses: actions/checkout@v3
197+
uses: actions/checkout@v4
197198
with:
198199
path: main
199200
200201
- name: Checkout tools repo
201-
uses: actions/checkout@v3
202+
uses: actions/checkout@v4
202203
with:
203204
repository: my-org/my-tools
204205
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
209210

210211
```yaml
211212
- name: Checkout
212-
uses: actions/checkout@v3
213+
uses: actions/checkout@v4
213214
214215
- name: Checkout tools repo
215-
uses: actions/checkout@v3
216+
uses: actions/checkout@v4
216217
with:
217218
repository: my-org/my-tools
218219
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
223224

224225
```yaml
225226
- name: Checkout
226-
uses: actions/checkout@v3
227+
uses: actions/checkout@v4
227228
with:
228229
path: main
229230
230231
- name: Checkout private tools
231-
uses: actions/checkout@v3
232+
uses: actions/checkout@v4
232233
with:
233234
repository: my-org/my-private-tools
234235
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
241242
## Checkout pull request HEAD commit instead of merge commit
242243

243244
```yaml
244-
- uses: actions/checkout@v3
245+
- uses: actions/checkout@v4
245246
with:
246247
ref: ${{ github.event.pull_request.head.sha }}
247248
```
@@ -257,7 +258,7 @@ jobs:
257258
build:
258259
runs-on: ubuntu-latest
259260
steps:
260-
- uses: actions/checkout@v3
261+
- uses: actions/checkout@v4
261262
```
262263

263264
## Push a commit using the built-in token
@@ -268,7 +269,7 @@ jobs:
268269
build:
269270
runs-on: ubuntu-latest
270271
steps:
271-
- uses: actions/checkout@v3
272+
- uses: actions/checkout@v4
272273
- run: |
273274
date > generated.txt
274275
git config user.name github-actions

src/misc/generate-docs.ts

+1-1
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)