1
0
mirror of https://github.com/actions/checkout.git synced 2026-03-10 09:01:44 +08:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Johnny Willemsen
9abac356f4
Merge f80349a6ad into 09d2acae67 2025-06-20 13:51:48 -04:00
Ben De St Paer-Gotch
09d2acae67
Update README.md (#2194) 2025-06-06 09:19:16 +01:00
Johnny Willemsen
f80349a6ad
Merge branch 'actions:main' into jwi-pathdocu 2022-09-02 14:11:12 +02:00
Johnny Willemsen
8af5cbfde0
Merge branch 'main' into jwi-pathdocu 2020-10-02 17:20:12 +02:00
Johnny Willemsen
d795c2780e
Move env to test step
* .github/workflows/test.yml:
2020-08-26 12:44:28 +02:00
Johnny Willemsen
d345e1892f
Back to basic
* .github/workflows/test.yml:
2020-08-26 12:26:01 +02:00
Johnny Willemsen
388793bd97
Use ref as it should
* .github/workflows/test.yml:
2020-08-26 12:25:15 +02:00
Johnny Willemsen
4f92610a97
Added environment based path test
* __test__/verify-environment-path.sh:
      Added.

    * .github/workflows/test.yml:
2020-08-26 12:18:55 +02:00
Johnny Willemsen
e67ad3383b
Removed side by side
* README.md:
2020-08-26 12:11:07 +02:00
Johnny Willemsen
146dd77449
The path can be relative or absolute under $GITHUB_WORKSPACE
* README.md:
    * action.yml:
    * adrs/0153-checkout-v2.md:
2020-08-26 12:09:04 +02:00
5 changed files with 51 additions and 3 deletions

View File

@ -29,6 +29,8 @@ jobs:
run: __test__/verify-no-unstaged-changes.sh run: __test__/verify-no-unstaged-changes.sh
test: test:
env:
main_path: main_path_test
strategy: strategy:
matrix: matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest] runs-on: [ubuntu-latest, macos-latest, windows-latest]
@ -62,6 +64,16 @@ jobs:
shell: bash shell: bash
run: __test__/verify-clean.sh 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 # Side by side
- name: Checkout side by side 1 - name: Checkout side by side 1
uses: ./ uses: ./

View File

@ -10,6 +10,24 @@ The auth token is persisted in the local git config. This enables your scripts t
When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files. When Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.
### Note
Thank you for your interest in this GitHub action, however, right now we are not taking contributions.
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features were working on and what stage theyre in.
We are taking the following steps to better direct requests related to GitHub Actions, including:
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
3. Security Issues should be handled as per our [security.md](security.md)
We will still provide security updates for this project and fix major breaking changes during this time.
You are welcome to still raise bugs in this repo.
# What's new # What's new
Please refer to the [release page](https://github.com/actions/checkout/releases/latest) for the latest release notes. Please refer to the [release page](https://github.com/actions/checkout/releases/latest) for the latest release notes.
@ -71,7 +89,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# Default: true # Default: true
persist-credentials: '' persist-credentials: ''
# Relative path under $GITHUB_WORKSPACE to place the repository # Relative or absolute path under $GITHUB_WORKSPACE to place the repository
path: '' path: ''
# Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching # Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching
@ -214,6 +232,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) > - 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) ## Checkout multiple repos (nested)
```yaml ```yaml

View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ ! -f "./main_path_test/basic-file.txt" ]; then
echo "Expected file does not exist"
exit 1
fi

View File

@ -53,7 +53,7 @@ inputs:
description: 'Whether to configure the token or SSH key with the local git config' description: 'Whether to configure the token or SSH key with the local git config'
default: true default: true
path: path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository' description: 'Relative or absolute path under $GITHUB_WORKSPACE to place the repository'
clean: clean:
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching' description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
default: true default: true

View File

@ -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' description: 'Whether to configure the token or SSH key with the local git config'
default: true default: true
path: path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository' description: 'Relative or absolute path under $GITHUB_WORKSPACE to place the repository'
clean: clean:
description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching' description: 'Whether to execute `git clean -ffdx && git reset --hard HEAD` before fetching'
default: true default: true