Merge pull request 'fix: lib/git-creds.sh + docker/edge/entrypoint-edge.sh: read $FORGE_PASS from env at git-runtime instead of baking it into the credential helper file (#669)' (#670) from fix/issue-669 into main
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
This commit is contained in:
commit
af8a58bf46
2 changed files with 4 additions and 2 deletions
|
|
@ -64,12 +64,13 @@ if [ -n "${FORGE_PASS:-}" ] && [ -n "${FORGE_URL:-}" ]; then
|
|||
|
||||
cat > "${HOME}/.git-credentials-helper" <<CREDEOF
|
||||
#!/bin/sh
|
||||
# Reads \$FORGE_PASS from env at runtime — file is safe to read on disk.
|
||||
[ "\$1" = "get" ] || exit 0
|
||||
cat >/dev/null
|
||||
echo "protocol=${_forge_proto}"
|
||||
echo "host=${_forge_host}"
|
||||
echo "username=${_bot_user}"
|
||||
echo "password=${FORGE_PASS}"
|
||||
echo "password=\$FORGE_PASS"
|
||||
CREDEOF
|
||||
chmod 755 "${HOME}/.git-credentials-helper"
|
||||
git config --global credential.helper "${HOME}/.git-credentials-helper"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ configure_git_creds() {
|
|||
cat > "$helper_path" <<CREDEOF
|
||||
#!/bin/sh
|
||||
# Auto-generated git credential helper for Forgejo password auth (#361, #604)
|
||||
# Reads \$FORGE_PASS from env at runtime — file is safe to read on disk.
|
||||
# Only respond to "get" action; ignore "store" and "erase".
|
||||
[ "\$1" = "get" ] || exit 0
|
||||
# Read and discard stdin (git sends protocol/host info)
|
||||
|
|
@ -56,7 +57,7 @@ cat >/dev/null
|
|||
echo "protocol=${forge_proto}"
|
||||
echo "host=${forge_host}"
|
||||
echo "username=${bot_user}"
|
||||
echo "password=${FORGE_PASS}"
|
||||
echo "password=\$FORGE_PASS"
|
||||
CREDEOF
|
||||
chmod 755 "$helper_path"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue