diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 5ff4ecca27..0ecac9c7af 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":"9296aa1a60ebc10a66fe902adc99306dc581ed3fa606a83a982d5e4cb6011db2","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"f9608483adcb0c79a5e69f9f9b65316d28ce066651d7b81cb1516ee8cfb30606","strict":true,"agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_ENDPOINT","GH_AW_OTEL_HEADERS","GITHUB_TOKEN"],"actions":[{"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.0.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"anchore/sbom-action","sha":"e22c389904149dbc22b58101806040fa8d37a610","version":"v0.24.0"},{"repo":"docker/build-push-action","sha":"bcafcacb16a39f128d818304e6c9c0c18556b85f","version":"v7.1.0"},{"repo":"docker/login-action","sha":"4907a6ddec9925e35a0a9e82d7399ccc52663121","version":"v4.1.0"},{"repo":"docker/metadata-action","sha":"030e881283bb7a6894de51c315a6bfe6a94e05cf","version":"v6.0.0 (source v6)"},{"repo":"docker/setup-buildx-action","sha":"4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd","version":"v4.0.0 (source v4)"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.42"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.42"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.42"},{"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"}]} # ___ _ _ # / _ \ | | (_) @@ -215,20 +215,20 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_22d62c419dcf34f1_EOF' + cat << 'GH_AW_PROMPT_957d319882c4382d_EOF' - GH_AW_PROMPT_22d62c419dcf34f1_EOF + GH_AW_PROMPT_957d319882c4382d_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_22d62c419dcf34f1_EOF' + cat << 'GH_AW_PROMPT_957d319882c4382d_EOF' Tools: update_release, missing_tool, missing_data, noop - GH_AW_PROMPT_22d62c419dcf34f1_EOF + GH_AW_PROMPT_957d319882c4382d_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_22d62c419dcf34f1_EOF' + cat << 'GH_AW_PROMPT_957d319882c4382d_EOF' The following GitHub context information is available for this workflow: {{#if __GH_AW_GITHUB_ACTOR__ }} @@ -257,15 +257,15 @@ jobs: {{/if}} - GH_AW_PROMPT_22d62c419dcf34f1_EOF + GH_AW_PROMPT_957d319882c4382d_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_22d62c419dcf34f1_EOF' + cat << 'GH_AW_PROMPT_957d319882c4382d_EOF' {{#runtime-import .github/workflows/shared/community-attribution.md}} {{#runtime-import .github/workflows/shared/observability-otlp.md}} {{#runtime-import .github/workflows/shared/noop-reminder.md}} {{#runtime-import .github/workflows/release.md}} - GH_AW_PROMPT_22d62c419dcf34f1_EOF + GH_AW_PROMPT_957d319882c4382d_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -493,9 +493,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_d817d61ef4086dbe_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_b1a69c0270c24336_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_d817d61ef4086dbe_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_b1a69c0270c24336_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -689,7 +689,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_832e51f705afaf7d_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_910694ced22ce5d3_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "github": { @@ -736,7 +736,7 @@ jobs: } } } - GH_AW_MCP_CONFIG_832e51f705afaf7d_EOF + GH_AW_MCP_CONFIG_910694ced22ce5d3_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true @@ -1432,8 +1432,32 @@ jobs: --prerelease \ --latest=false - # Get release ID - RELEASE_ID=$(gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId') + # Get release ID (retry to handle eventual consistency) + MAX_ATTEMPTS=5 + RELEASE_ID="" + for attempt in $(seq 1 "$MAX_ATTEMPTS"); do + set +e + release_view_output=$(gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId' 2>&1) + release_view_status=$? + set -e + if [ "$release_view_status" -eq 0 ] && [ -n "$release_view_output" ]; then + RELEASE_ID="$release_view_output" + break + fi + if ! echo "$release_view_output" | grep -qiE "not found|404"; then + echo "Error: Failed to resolve release ID for $RELEASE_TAG" + echo "$release_view_output" + exit 1 + fi + if [ "$attempt" -lt "$MAX_ATTEMPTS" ]; then + echo "Release ID not available yet (attempt $attempt/$MAX_ATTEMPTS); retrying..." + sleep $((2 ** attempt)) + fi + done + if [ -z "$RELEASE_ID" ]; then + echo "Error: Failed to resolve release ID for $RELEASE_TAG after $MAX_ATTEMPTS attempts" + exit 1 + fi echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT" echo "✓ Release created: $RELEASE_TAG" echo "✓ Release ID: $RELEASE_ID" diff --git a/.github/workflows/release.md b/.github/workflows/release.md index 5287018d7d..811cc39468 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -278,8 +278,32 @@ jobs: --prerelease \ --latest=false - # Get release ID - RELEASE_ID=$(gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId') + # Get release ID (retry to handle eventual consistency) + MAX_ATTEMPTS=5 + RELEASE_ID="" + for attempt in $(seq 1 "$MAX_ATTEMPTS"); do + set +e + release_view_output=$(gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId' 2>&1) + release_view_status=$? + set -e + if [ "$release_view_status" -eq 0 ] && [ -n "$release_view_output" ]; then + RELEASE_ID="$release_view_output" + break + fi + if ! echo "$release_view_output" | grep -qiE "not found|404"; then + echo "Error: Failed to resolve release ID for $RELEASE_TAG" + echo "$release_view_output" + exit 1 + fi + if [ "$attempt" -lt "$MAX_ATTEMPTS" ]; then + echo "Release ID not available yet (attempt $attempt/$MAX_ATTEMPTS); retrying..." + sleep $((2 ** attempt)) + fi + done + if [ -z "$RELEASE_ID" ]; then + echo "Error: Failed to resolve release ID for $RELEASE_TAG after $MAX_ATTEMPTS attempts" + exit 1 + fi echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT" echo "✓ Release created: $RELEASE_TAG" echo "✓ Release ID: $RELEASE_ID"