feat: switch source URLs from GitHub to Forgejo

Hybride model (PBI-86 in Scrum4Me): de worker clonet en pusht naar
Forgejo (`origin`); GitHub-PR's ontstaan via een handmatige
promote-Action in Forgejo. Variabele-namen blijven `GH_TOKEN` en
`GH_PRECLONE_REPOS` (historisch); inhoud is voortaan een Forgejo-PAT.

- Dockerfile: MCP_GIT_REPO default →
  git.jp-visser.nl/janpeter/scrum4me-mcp.git
- bin/repo-bootstrap.sh: credential-helper host + clone-URL →
  git.jp-visser.nl
- bin/job-prepare.sh: cache-slug comment example bijgewerkt
- .env.example: documentatie + default `GH_PRECLONE_REPOS` naar
  janpeter/Scrum4Me + janpeter/scrum4me-mcp; instructies omgezet naar
  Forgejo-PAT-flow; `gh pr create` (auto_pr) verwijderd uit comment.
- README.md: internet-egress, token-instructies, clone-URL en
  repo-bootstrap-sectie verwijzen nu naar Forgejo. Promote-flow gelinkt.

gh CLI install blijft in Dockerfile staan (no-op zonder gh-aanroepen,
maar weinig kosten om voor ad-hoc gebruik te bewaren).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Madhura68 2026-05-15 17:59:11 +02:00
parent 7ec32c8def
commit cb8f48d49e
5 changed files with 38 additions and 30 deletions

View file

@ -28,7 +28,7 @@ if [[ -z "$JOB_ID" || -z "$REPO_URL" ]]; then
exit 2
fi
# Slug uit repo_url voor de cache-naam: "github.com/foo/bar.git" → "foo_bar"
# Slug uit repo_url voor de cache-naam: "git.jp-visser.nl/foo/bar.git" → "foo_bar"
SLUG=$(echo "$REPO_URL" \
| sed -E 's#^.*[:/]([^/]+/[^/]+?)(\.git)?/?$#\1#' \
| tr '/' '_')

View file

@ -32,8 +32,8 @@ fi
mkdir -p "$HOME"
git config --global credential.helper store
CREDS_FILE="$HOME/.git-credentials"
if [[ ! -f "$CREDS_FILE" ]] || ! grep -q "oauth2:${GH_TOKEN}@github.com" "$CREDS_FILE" 2>/dev/null; then
printf 'https://oauth2:%s@github.com\n' "$GH_TOKEN" > "$CREDS_FILE"
if [[ ! -f "$CREDS_FILE" ]] || ! grep -q "oauth2:${GH_TOKEN}@git.jp-visser.nl" "$CREDS_FILE" 2>/dev/null; then
printf 'https://oauth2:%s@git.jp-visser.nl\n' "$GH_TOKEN" > "$CREDS_FILE"
chmod 600 "$CREDS_FILE"
log "git credentials helper configured at ${CREDS_FILE}"
fi
@ -71,7 +71,7 @@ for repo in "${REPOS[@]}"; do
else
log "cloning ${repo} into ${target}"
rm -rf "$target"
git clone --quiet "https://github.com/${repo}.git" "$target" \
git clone --quiet "https://git.jp-visser.nl/${repo}.git" "$target" \
|| { log "ERROR: clone failed for ${repo}"; continue; }
fi
done