Skip to content

Commit

Permalink
chore: removes input repository from the safe workspace (#185)
Browse files Browse the repository at this point in the history
The input repository should always exist in the GitHub workspace.
Setting it again in the entrypoint is redundant.

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 authored Mar 12, 2024
1 parent 6d42bb4 commit 983384e
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions actions/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@
# Manage newest git versions (related to CVE https://github.blog/2022-04-12-git-security-vulnerability-announced/)
#
function set_git_safe_directory() {
if [[ -z "${GITHUB_WORKSPACE+x}" ]]; then
echo "Setting git safe.directory default: /github/workspace ..."
git config --global --add safe.directory /github/workspace
if [[ -z "${GITHUB_WORKSPACE}" ]]; then
echo "GITHUB_WORKSPACE is not set. Exiting..."
exit 1
else
echo "Setting git safe.directory GITHUB_WORKSPACE: $GITHUB_WORKSPACE ..."
git config --global --add safe.directory "$GITHUB_WORKSPACE"
fi

if [[ -z "${INPUT_REPOSITORY+x}" ]]; then
echo "Skipping setting working directory as safe directory"
else
echo "Setting git safe.directory default: $INPUT_REPOSITORY ..."
git config --global --add safe.directory "$INPUT_REPOSITORY"
echo "Setting git safe.directory GITHUB_WORKSPACE: $GITHUB_WORKSPACE ..."
git config --global --add safe.directory "$GITHUB_WORKSPACE"
fi
}

Expand Down

0 comments on commit 983384e

Please sign in to comment.