Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cory-miller committed Oct 17, 2023
1 parent 3df4ab1 commit 1e31de5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions README.md
@@ -1,6 +1,6 @@
[![Build and Test](https://github.com/actions/checkout/actions/workflows/test.yml/badge.svg)](https://github.com/actions/checkout/actions/workflows/test.yml)

# Checkout V3
# Checkout V4

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

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

# What's new

- Updated to the node16 runtime by default
- 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.
- Updated to the node20 runtime by default
- 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.

# Usage

<!-- start usage -->
```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
Expand Down Expand Up @@ -139,15 +139,15 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
## Fetch only the root files

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
sparse-checkout: .
```

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

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

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
sparse-checkout: |
README.md
Expand All @@ -167,23 +167,23 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
## Fetch all history for all tags and branches

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
```

## Checkout a different branch

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: my-branch
```

## Checkout HEAD^

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: git checkout HEAD^
Expand All @@ -193,12 +193,12 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl

```yaml
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: main

- name: Checkout tools repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: my-org/my-tools
path: my-tools
Expand All @@ -209,10 +209,10 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl

```yaml
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout tools repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: my-org/my-tools
path: my-tools
Expand All @@ -223,12 +223,12 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl

```yaml
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: main

- name: Checkout private tools
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: my-org/my-private-tools
token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT
Expand All @@ -241,7 +241,7 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl
## Checkout pull request HEAD commit instead of merge commit

```yaml
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
```
Expand All @@ -257,7 +257,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
```

## Push a commit using the built-in token
Expand All @@ -268,7 +268,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
date > generated.txt
git config user.name github-actions
Expand Down
2 changes: 1 addition & 1 deletion src/misc/generate-docs.ts
Expand Up @@ -120,7 +120,7 @@ function updateUsage(
}

updateUsage(
'actions/checkout@v3',
'actions/checkout@v4',
path.join(__dirname, '..', '..', 'action.yml'),
path.join(__dirname, '..', '..', 'README.md')
)

0 comments on commit 1e31de5

Please sign in to comment.