From e7a42ee3492593a1bffda4c231f0f8aa5c9a23c4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 12:09:54 +0000 Subject: [PATCH] Fix failing agent job: fetch full git history and tags before git range queries Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .github/workflows/release.lock.yml | 28 ++++++++++++++-------------- .github/workflows/release.md | 7 +++++++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 7f9fb8e..60c6d7d 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"c799008aa57ae401e20f053978918b36f58e8e3c5d388ab30c721129c9ee59a0","compiler_version":"v0.72.1","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"e2a808de2c45adb43730f71d5d3b5b3cedbea11fec4c9418d6173346ac7c6bba","compiler_version":"v0.72.1","strict":true,"agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"34e114876b0b11c390a56381ad16ebd13914f8d5","version":"v4"},{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"bc56a0cad2f450c562810785ef38649c04db812a","version":"v0.72.1"},{"repo":"github/gh-aw-actions/setup-cli","sha":"f8495a686e66770ae977f82732f34d7340ee42a4","version":"f8495a686e66770ae977f82732f34d7340ee42a4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.41","digest":"sha256:cb2b565d070116d4b67e355775340528b5a2c3cb18b2c9049638bcc2df681770","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.41@sha256:cb2b565d070116d4b67e355775340528b5a2c3cb18b2c9049638bcc2df681770"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.41","digest":"sha256:fadd0de387209f69a9a7a1b8722bb5e7fdfb80ba9749a5c60f0e4cd7582a74d0","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.41@sha256:fadd0de387209f69a9a7a1b8722bb5e7fdfb80ba9749a5c60f0e4cd7582a74d0"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.41","digest":"sha256:1260445d25968dbf3ae70143964177a0e5914cf2ce07a6117f7d3caec6c3e3c4","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.41@sha256:1260445d25968dbf3ae70143964177a0e5914cf2ce07a6117f7d3caec6c3e3c4"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} # ___ _ _ # / _ \ | | (_) @@ -196,20 +196,20 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_3a1e09a3d5e0a833_EOF' + cat << 'GH_AW_PROMPT_0afa61e5b582b956_EOF' - GH_AW_PROMPT_3a1e09a3d5e0a833_EOF + GH_AW_PROMPT_0afa61e5b582b956_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_3a1e09a3d5e0a833_EOF' + cat << 'GH_AW_PROMPT_0afa61e5b582b956_EOF' Tools: update_release, missing_tool, missing_data, noop - GH_AW_PROMPT_3a1e09a3d5e0a833_EOF + GH_AW_PROMPT_0afa61e5b582b956_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_3a1e09a3d5e0a833_EOF' + cat << 'GH_AW_PROMPT_0afa61e5b582b956_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -238,12 +238,12 @@ jobs: {{/if}} - GH_AW_PROMPT_3a1e09a3d5e0a833_EOF + GH_AW_PROMPT_0afa61e5b582b956_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_3a1e09a3d5e0a833_EOF' + cat << 'GH_AW_PROMPT_0afa61e5b582b956_EOF' {{#runtime-import .github/workflows/release.md}} - GH_AW_PROMPT_3a1e09a3d5e0a833_EOF + GH_AW_PROMPT_0afa61e5b582b956_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -382,7 +382,7 @@ jobs: RELEASE_TAG: ${{ needs.release.outputs.release_tag }} RELEASE_TARGET: ${{ inputs.target }} name: Prepare release context - run: "set -euo pipefail\nmkdir -p /tmp/gh-aw/release-data\n\ngh api \"/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID\" > /tmp/gh-aw/release-data/current_release.json\n\ngh release list --limit 10 --json tagName,name,publishedAt,isLatest \\\n > /tmp/gh-aw/release-data/releases.json\n\njq --arg tag \"$RELEASE_TAG\" '[.[] | select(.tagName != $tag)][0] // null' \\\n /tmp/gh-aw/release-data/releases.json \\\n > /tmp/gh-aw/release-data/previous_release.json\n\nPREVIOUS_TAG=$(jq -r '.tagName // empty' /tmp/gh-aw/release-data/previous_release.json)\nCURRENT_VERSION=${RELEASE_TAG#v}\nPREVIOUS_VERSION=${PREVIOUS_TAG#v}\n\njq -n \\\n --arg current_tag \"$RELEASE_TAG\" \\\n --arg current_version \"$CURRENT_VERSION\" \\\n --arg previous_tag \"$PREVIOUS_TAG\" \\\n --arg previous_version \"$PREVIOUS_VERSION\" \\\n --arg release_target \"$RELEASE_TARGET\" \\\n '{\n current_tag: $current_tag,\n current_version: $current_version,\n previous_tag: ($previous_tag | select(length > 0)),\n previous_version: ($previous_version | select(length > 0)),\n release_target: $release_target\n }' > /tmp/gh-aw/release-data/semver_context.json\n\nif [ -n \"$PREVIOUS_TAG\" ]; then\n git log --no-merges --reverse --pretty=format:'%H%x09%s' \"$PREVIOUS_TAG..$RELEASE_TARGET\" \\\n > /tmp/gh-aw/release-data/commit_subjects.tsv\n git diff --name-only \"$PREVIOUS_TAG..$RELEASE_TARGET\" \\\n > /tmp/gh-aw/release-data/changed_files.txt\nelse\n : > /tmp/gh-aw/release-data/commit_subjects.tsv\n find workflows -maxdepth 1 -type f -name '*.md' | sort \\\n > /tmp/gh-aw/release-data/changed_files.txt\nfi\n\nfind workflows -maxdepth 1 -type f -name '*.md' | sort \\\n > /tmp/gh-aw/release-data/workflow_sources.txt\n" + run: "set -euo pipefail\nmkdir -p /tmp/gh-aw/release-data\n\ngh api \"/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID\" > /tmp/gh-aw/release-data/current_release.json\n\ngh release list --limit 10 --json tagName,name,publishedAt,isLatest \\\n > /tmp/gh-aw/release-data/releases.json\n\njq --arg tag \"$RELEASE_TAG\" '[.[] | select(.tagName != $tag)][0] // null' \\\n /tmp/gh-aw/release-data/releases.json \\\n > /tmp/gh-aw/release-data/previous_release.json\n\nPREVIOUS_TAG=$(jq -r '.tagName // empty' /tmp/gh-aw/release-data/previous_release.json)\nCURRENT_VERSION=${RELEASE_TAG#v}\nPREVIOUS_VERSION=${PREVIOUS_TAG#v}\n\njq -n \\\n --arg current_tag \"$RELEASE_TAG\" \\\n --arg current_version \"$CURRENT_VERSION\" \\\n --arg previous_tag \"$PREVIOUS_TAG\" \\\n --arg previous_version \"$PREVIOUS_VERSION\" \\\n --arg release_target \"$RELEASE_TARGET\" \\\n '{\n current_tag: $current_tag,\n current_version: $current_version,\n previous_tag: ($previous_tag | select(length > 0)),\n previous_version: ($previous_version | select(length > 0)),\n release_target: $release_target\n }' > /tmp/gh-aw/release-data/semver_context.json\n\nif [ -n \"$PREVIOUS_TAG\" ]; then\n # The agent job checkout is shallow by default; fetch full history and tags\n # so that the \"$PREVIOUS_TAG..$RELEASE_TARGET\" revision range is resolvable.\n SERVER_HOST=\"${GITHUB_SERVER_URL#https://}\"\n git remote set-url origin \"https://x-access-token:${GH_TOKEN}@${SERVER_HOST}/${GITHUB_REPOSITORY}.git\"\n git fetch --unshallow --tags 2>/dev/null || git fetch --tags\n git remote set-url origin \"https://${SERVER_HOST}/${GITHUB_REPOSITORY}.git\"\n\n git log --no-merges --reverse --pretty=format:'%H%x09%s' \"$PREVIOUS_TAG..$RELEASE_TARGET\" \\\n > /tmp/gh-aw/release-data/commit_subjects.tsv\n git diff --name-only \"$PREVIOUS_TAG..$RELEASE_TARGET\" \\\n > /tmp/gh-aw/release-data/changed_files.txt\nelse\n : > /tmp/gh-aw/release-data/commit_subjects.tsv\n find workflows -maxdepth 1 -type f -name '*.md' | sort \\\n > /tmp/gh-aw/release-data/changed_files.txt\nfi\n\nfind workflows -maxdepth 1 -type f -name '*.md' | sort \\\n > /tmp/gh-aw/release-data/workflow_sources.txt\n" - name: Configure Git credentials env: @@ -450,9 +450,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_1cc74fd6b63ad8c0_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_df5061985339d58c_EOF' {"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{},"update_release":{"max":1}} - GH_AW_SAFE_OUTPUTS_CONFIG_1cc74fd6b63ad8c0_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_df5061985339d58c_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -644,7 +644,7 @@ jobs: mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_f6f73cfbae644b0b_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_9ed7e700aede7e9c_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { @@ -685,7 +685,7 @@ jobs: "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" } } - GH_AW_MCP_CONFIG_f6f73cfbae644b0b_EOF + GH_AW_MCP_CONFIG_9ed7e700aede7e9c_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true diff --git a/.github/workflows/release.md b/.github/workflows/release.md index d336c7f..7e2685d 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -108,6 +108,13 @@ steps: }' > /tmp/gh-aw/release-data/semver_context.json if [ -n "$PREVIOUS_TAG" ]; then + # The agent job checkout is shallow by default; fetch full history and tags + # so that the "$PREVIOUS_TAG..$RELEASE_TARGET" revision range is resolvable. + SERVER_HOST="${GITHUB_SERVER_URL#https://}" + git remote set-url origin "https://x-access-token:${GH_TOKEN}@${SERVER_HOST}/${GITHUB_REPOSITORY}.git" + git fetch --unshallow --tags 2>/dev/null || git fetch --tags + git remote set-url origin "https://${SERVER_HOST}/${GITHUB_REPOSITORY}.git" + git log --no-merges --reverse --pretty=format:'%H%x09%s' "$PREVIOUS_TAG..$RELEASE_TARGET" \ > /tmp/gh-aw/release-data/commit_subjects.tsv git diff --name-only "$PREVIOUS_TAG..$RELEASE_TARGET" \