Skip to content

Commit 4930b2e

Browse files
Copilotmrjf
andauthored
Address review: avoid token-in-URL via http.extraHeader; document inf fallback
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/a98d4d22-8daa-4733-ab25-6cd7025a0ddc Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent ed9421b commit 4930b2e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/autoloop.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ steps:
9999
if [ -d /tmp/gh-aw/repo-memory/autoloop/.git ]; then
100100
echo "repo-memory/autoloop already cloned; skipping"
101101
else
102-
git clone --depth=1 --branch memory/autoloop \
103-
"https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \
102+
# Pass the token via an http.extraHeader rather than embedding it in the
103+
# URL — keeps it out of process listings and any logged remote URLs.
104+
AUTH_HEADER="Authorization: Basic $(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 -w0)"
105+
git -c "http.extraHeader=${AUTH_HEADER}" clone --depth=1 --branch memory/autoloop \
106+
"https://github.com/${GITHUB_REPOSITORY}.git" \
104107
/tmp/gh-aw/repo-memory/autoloop \
105108
|| {
106109
echo "memory/autoloop branch not found (first run); creating empty dir"
@@ -451,8 +454,9 @@ steps:
451454
# Tiebreaker rationale: programs that have never run (no last_run) take
452455
# priority over ever-run programs; among never-run programs, prefer the
453456
# shortest schedule (so "every 30m" beats "every 6h"), then alphabetical
454-
# by name. This avoids permanent starvation when state is missing — see
455-
# issue: "Autoloop pre-step can't read state files".
457+
# by name. Programs with no parseable schedule sort last among never-run
458+
# programs (float('inf')). This avoids permanent starvation when state
459+
# is missing — see issue: "Autoloop pre-step can't read state files".
456460
def _due_sort_key(p):
457461
if p["last_run"]:
458462
return (1, p["last_run"], p["name"])

0 commit comments

Comments
 (0)