-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
94 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# checkout | ||
|
||
GitHub Action for checking out a repository. | ||
There is no stability guarantee for this action, since it's supposed to only be | ||
used in infra managed by us. | ||
|
||
## Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
```yaml | ||
- uses: taiki-e/github-actions/checkout@main | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: checkout | ||
description: GitHub Action for checking out a repository. | ||
|
||
# Note: | ||
# - inputs.* should be manually mapped to INPUT_* due to https://github.com/actions/runner/issues/665 | ||
# - Use GITHUB_*/RUNNER_* instead of github.*/runner.* due to https://github.com/actions/runner/issues/2185 | ||
runs: | ||
using: composite | ||
steps: | ||
- run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
# SPDX-License-Identifier: Apache-2.0 OR MIT | ||
set -eEuo pipefail | ||
IFS=$'\n\t' | ||
|
||
g() { | ||
local cmd="$1" | ||
shift | ||
IFS=' ' | ||
echo "::group::${cmd} $*" | ||
IFS=$'\n\t' | ||
"${cmd}" "$@" | ||
} | ||
retry() { | ||
for i in {1..10}; do | ||
if "$@"; then | ||
return 0 | ||
else | ||
sleep "${i}" | ||
fi | ||
done | ||
"$@" | ||
} | ||
|
||
wd=$(pwd) | ||
|
||
g git version | ||
|
||
g git init | ||
g git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" | ||
|
||
g git config --local gc.auto 0 | ||
|
||
g retry git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "+${GITHUB_SHA}:${GITHUB_REF}" | ||
|
||
g retry git checkout --progress --force "${GITHUB_REF}" | ||
|
||
g git config --global --add safe.directory "${wd}" |