Compare commits

...

11 commits

Author SHA1 Message Date
Johnny Willemsen
c7da236801
Merge f80349a6ad into 85e6279cec 2025-02-01 11:08:31 +00:00
Josh Gross
85e6279cec
Adjust positioning of user email note and permissions heading (#2044)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Licensed / Check licenses (push) Has been cancelled
Build and Test / build (push) Has been cancelled
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (ubuntu-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
Build and Test / test-proxy (push) Has been cancelled
Build and Test / test-bypass-proxy (push) Has been cancelled
Build and Test / test-git-container (push) Has been cancelled
Build and Test / test-output (push) Has been cancelled
2025-01-16 15:56:18 -05:00
Ben Wells
009b9ae9e4
Documentation update - add recommended permissions to Readme (#2043)
* Update README.md

* Update README.md

Co-authored-by: Josh Gross <joshmgross@github.com>

---------

Co-authored-by: Josh Gross <joshmgross@github.com>
2025-01-16 14:14:48 -05: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 42 additions and 3 deletions

View file

@ -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]
@ -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: ./

View file

@ -71,7 +71,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
@ -214,6 +214,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
@ -311,8 +323,17 @@ jobs:
git commit -m "generated"
git push
```
*NOTE:* The user email is `{user.id}+{user.login}@users.noreply.github.com`. See users API: https://api.github.com/users/github-actions%5Bbot%5D
# Recommended permissions
When using the `checkout` action in your GitHub Actions workflow, it is recommended to set the following `GITHUB_TOKEN` permissions to ensure proper functionality, unless alternative auth is provided via the `token` or `ssh-key` inputs:
```yaml
permissions:
contents: read
```
# License

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'
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

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'
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