15 lines
420 B
Bash
Executable File
15 lines
420 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
URL="${GITHUB_SERVER_URL/\/\//\/\/$GITHUB_REPOSITORY_OWNER:$INPUT_TOKEN@}/$GITHUB_REPOSITORY"
|
|
|
|
git init -b main
|
|
git remote add origin "$URL"
|
|
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin "$GITHUB_SHA"
|
|
git checkout --progress --force -B main "$GITHUB_SHA"
|
|
|
|
if [ -n "$INPUT_SUBPATH" ]; then (
|
|
shopt -s extglob dotglob
|
|
rm !("$INPUT_SUBPATH")
|
|
mv -T "$INPUT_SUBPATH" .
|
|
) fi
|