We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6506e31 commit 070c08cCopy full SHA for 070c08c
1 file changed
action.yml
@@ -47,8 +47,10 @@ runs:
47
}
48
49
# --- Ensure we have enough history + refs ---
50
- # Make sure 'origin' is set (usually already set by actions/checkout)
51
- git remote set-url origin "${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY}.git" || true
+ # Ensure 'origin' exists but never rewrite an existing remote URL/config.
+ if ! git remote get-url origin >/dev/null 2>&1; then
52
+ git remote add origin "${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY}.git"
53
+ fi
54
55
if git rev-parse --is-shallow-repository >/dev/null 2>&1 && [[ "$(git rev-parse --is-shallow-repository)" == "true" ]]; then
56
# Fully unshallow if possible so --contains works reliably
0 commit comments