fix: fix: edge entrypoint clones disinto repo without auth — fails when Forgejo requires authentication (#353)
This commit is contained in:
parent
863925cb1c
commit
8480308d1d
3 changed files with 19 additions and 4 deletions
|
|
@ -8,6 +8,19 @@
|
|||
when:
|
||||
event: [push, pull_request]
|
||||
|
||||
# Override default clone to authenticate against Forgejo using FORGE_TOKEN.
|
||||
# Required because Forgejo is configured with REQUIRE_SIGN_IN, so anonymous
|
||||
# git clones fail with exit code 128. FORGE_TOKEN is injected globally via
|
||||
# WOODPECKER_ENVIRONMENT in docker-compose.yml (generated by lib/generators.sh).
|
||||
clone:
|
||||
git:
|
||||
image: alpine/git
|
||||
commands:
|
||||
- AUTH_URL=$(printf '%s' "$CI_REPO_CLONE_URL" | sed "s|://|://token:$FORGE_TOKEN@|")
|
||||
- git clone --depth 1 "$AUTH_URL" .
|
||||
- git fetch --depth 1 origin "$CI_COMMIT_REF"
|
||||
- git checkout FETCH_HEAD
|
||||
|
||||
steps:
|
||||
- name: shellcheck
|
||||
image: koalaman/shellcheck-alpine:stable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue