Skip to content

Commit e7a42ee

Browse files
Copilotmnkiefer
andauthored
Fix failing agent job: fetch full git history and tags before git range queries
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
1 parent 9547d6e commit e7a42ee

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

.github/workflows/release.lock.yml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ steps:
108108
}' > /tmp/gh-aw/release-data/semver_context.json
109109
110110
if [ -n "$PREVIOUS_TAG" ]; then
111+
# The agent job checkout is shallow by default; fetch full history and tags
112+
# so that the "$PREVIOUS_TAG..$RELEASE_TARGET" revision range is resolvable.
113+
SERVER_HOST="${GITHUB_SERVER_URL#https://}"
114+
git remote set-url origin "https://x-access-token:${GH_TOKEN}@${SERVER_HOST}/${GITHUB_REPOSITORY}.git"
115+
git fetch --unshallow --tags 2>/dev/null || git fetch --tags
116+
git remote set-url origin "https://${SERVER_HOST}/${GITHUB_REPOSITORY}.git"
117+
111118
git log --no-merges --reverse --pretty=format:'%H%x09%s' "$PREVIOUS_TAG..$RELEASE_TARGET" \
112119
> /tmp/gh-aw/release-data/commit_subjects.tsv
113120
git diff --name-only "$PREVIOUS_TAG..$RELEASE_TARGET" \

0 commit comments

Comments
 (0)