mirror of https://github.com/actions/checkout
Compare commits
11 Commits
cd207397dc
...
0f0e7985d9
| Author | SHA1 | Date |
|---|---|---|
|
|
0f0e7985d9 | |
|
|
4f1f4aec02 | |
|
|
ba097532fb | |
|
|
f80349a6ad | |
|
|
8af5cbfde0 | |
|
|
d795c2780e | |
|
|
d345e1892f | |
|
|
388793bd97 | |
|
|
4f92610a97 | |
|
|
e67ad3383b | |
|
|
146dd77449 |
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Set Node.js 24.x
|
||||
uses: actions/setup-node@v6
|
||||
|
|
@ -44,7 +44,7 @@ jobs:
|
|||
fi
|
||||
|
||||
# If dist/ was different than expected, upload the expected version as an artifact
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||
with:
|
||||
name: dist
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v4
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
name: Check licenses
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
- run: npm ci
|
||||
- run: npm run licensed-check
|
||||
|
|
@ -14,7 +14,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24.x
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm run format-check
|
||||
|
|
@ -29,6 +29,8 @@ jobs:
|
|||
run: __test__/verify-no-unstaged-changes.sh
|
||||
|
||||
test:
|
||||
env:
|
||||
main_path: main_path_test
|
||||
strategy:
|
||||
matrix:
|
||||
runs-on: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
|
@ -37,7 +39,7 @@ jobs:
|
|||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
|
||||
# Basic checkout
|
||||
- name: Checkout basic
|
||||
|
|
@ -62,6 +64,16 @@ jobs:
|
|||
shell: bash
|
||||
run: __test__/verify-clean.sh
|
||||
|
||||
# Use environment variable as path
|
||||
- name: Environment path test
|
||||
uses: ./
|
||||
with:
|
||||
ref: test-data/v2/basic
|
||||
path: ${{ env.main_path }}
|
||||
- name: Verify environment path test
|
||||
shell: bash
|
||||
run: __test__/verify-environment-path.sh
|
||||
|
||||
# Side by side
|
||||
- name: Checkout side by side 1
|
||||
uses: ./
|
||||
|
|
@ -229,7 +241,7 @@ jobs:
|
|||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
|
||||
# Basic checkout using git
|
||||
- name: Checkout basic
|
||||
|
|
@ -261,7 +273,7 @@ jobs:
|
|||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
|
||||
# Basic checkout using git
|
||||
- name: Checkout basic
|
||||
|
|
@ -291,7 +303,7 @@ jobs:
|
|||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
path: localClone
|
||||
|
||||
|
|
@ -319,7 +331,7 @@ jobs:
|
|||
|
||||
# needed to make checkout post cleanup succeed
|
||||
- name: Fix Checkout v6
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
path: localClone
|
||||
|
||||
|
|
@ -328,7 +340,7 @@ jobs:
|
|||
steps:
|
||||
# Clone this repo
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
path: actions-checkout
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ jobs:
|
|||
# Note this update workflow can also be used as a rollback tool.
|
||||
# For that reason, it's best to pin `actions/checkout` to a known, stable version
|
||||
# (typically, about two releases back).
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Git config
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v7
|
||||
|
||||
# Use `docker/login-action` to log in to GHCR.io.
|
||||
# Once published, the packages are scoped to the account defined here.
|
||||
|
|
|
|||
14
README.md
14
README.md
|
|
@ -113,7 +113,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||
# Default: true
|
||||
persist-credentials: ''
|
||||
|
||||
# Relative path under $GITHUB_WORKSPACE to place the repository
|
||||
# Relative or absolute path under $GITHUB_WORKSPACE to place the repository
|
||||
path: ''
|
||||
|
||||
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
|
||||
|
|
@ -274,6 +274,18 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
|
|||
```
|
||||
> - If your secondary repository is private or internal you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private)
|
||||
|
||||
## Checkout repo with a environment based path
|
||||
|
||||
```yaml
|
||||
env:
|
||||
main_path: ${{ github.workspace }}/main
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: ${{ env.main_path }}
|
||||
```
|
||||
|
||||
## Checkout multiple repos (nested)
|
||||
|
||||
```yaml
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! -f "./main_path_test/basic-file.txt" ]; then
|
||||
echo "Expected file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -53,7 +53,7 @@ inputs:
|
|||
description: 'Whether to configure the token or SSH key with the local git config'
|
||||
default: true
|
||||
path:
|
||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||
description: 'Relative or absolute path under $GITHUB_WORKSPACE to place the repository'
|
||||
clean:
|
||||
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
|
||||
default: true
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ We want to take this opportunity to make behavioral changes, from v1. This docum
|
|||
description: 'Whether to configure the token or SSH key with the local git config'
|
||||
default: true
|
||||
path:
|
||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||
description: 'Relative or absolute path under $GITHUB_WORKSPACE to place the repository'
|
||||
clean:
|
||||
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
|
||||
default: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue