From 146dd77449a0efd02f75d5bc5e4c69c3583cea2b Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 26 Aug 2020 12:09:04 +0200 Subject: [PATCH] The path can be relative or absolute under $GITHUB_WORKSPACE * README.md: * action.yml: * adrs/0153-checkout-v2.md: --- README.md | 14 +++++++++++++- action.yml | 2 +- adrs/0153-checkout-v2.md | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9c56a6f..2143962 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous # 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 @@ -160,6 +160,18 @@ Refer [here](https://github.com/actions/checkout/blob/v1/README.md) for previous path: my-tools ``` +## Checkout repo with a environment based path (side by side) + +```yaml +env: + main_path: ${{ github.workspace }}/main +steps: +- name: Checkout + uses: actions/checkout@v2 + with: + path: ${{ env.main_path }} +``` + ## Checkout multiple repos (nested) ```yaml diff --git a/action.yml b/action.yml index 91d3982..19ea55e 100644 --- a/action.yml +++ b/action.yml @@ -49,7 +49,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 diff --git a/adrs/0153-checkout-v2.md b/adrs/0153-checkout-v2.md index 74730c7..ebe1f5f 100644 --- a/adrs/0153-checkout-v2.md +++ b/adrs/0153-checkout-v2.md @@ -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 @@ -287,4 +287,4 @@ Note: - Update samples to consume `actions/checkout@v2` - Job containers now require git in the PATH for checkout, otherwise fallback to REST API - Minimum git version 2.18 -- Update problem matcher logic regarding source file verification (runner) \ No newline at end of file +- Update problem matcher logic regarding source file verification (runner)