diff --git a/.github/workflows/issue-arborist.lock.yml b/.github/workflows/issue-arborist.lock.yml index 60a9be720d..90eb0f9cb4 100644 --- a/.github/workflows/issue-arborist.lock.yml +++ b/.github/workflows/issue-arborist.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"3f6b2d24d450c19b62a379412443e6b91615328347c9f84a5e0d71219cf9cc5a","compiler_version":"v0.72.1","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"c6bce002c3be9f8bb217ced93ab309dbc6bcd5615d12ef52d41532ce4cf97c73","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":"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/github-script","sha":"d746ffe35508b1917358783b479e04febd2b8f71","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"bc56a0cad2f450c562810785ef38649c04db812a","version":"v0.72.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.41"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.41"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.41"},{"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"}]} # ___ _ _ # / _ \ | | (_) @@ -376,6 +376,7 @@ jobs: bash "${RUNNER_TEMP}/gh-aw/actions/start_difc_proxy.sh" - env: GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} + GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }} GH_HOST: localhost:18443 GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -390,13 +391,34 @@ jobs: echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..." - # Fetch the last 100 open issues that don't have a parent issue - gh issue list --repo $GH_AW_GITHUB_REPOSITORY \ - --search "-parent-issue:*" \ - --state open \ - --json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \ - --limit 100 \ - > /tmp/gh-aw/issues-data/issues.json + # Use REST API directly to avoid gh CLI /meta check blocked by DIFC proxy. + # Fetches the most recently created 100 issues (intentional limit matching previous behavior). + # State is normalized to uppercase (OPEN/CLOSED) to match gh CLI GraphQL output format. + curl -s \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + --get \ + --data-urlencode "q=repo:${GH_AW_GITHUB_REPOSITORY} is:issue is:open -is:sub-issue" \ + --data-urlencode "sort=created" \ + --data-urlencode "order=desc" \ + --data-urlencode "per_page=100" \ + "${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \ + | jq '.items // [] | map({ + number: .number, + title: .title, + author: {login: .user.login}, + createdAt: .created_at, + state: (.state | ascii_upcase), + url: .html_url, + body: .body, + labels: [.labels[] | {name: .name}], + updatedAt: .updated_at, + closedAt: .closed_at, + milestone: (if .milestone != null then {title: .milestone.title} else null end), + assignees: [.assignees[] | {login: .login}] + })' \ + > /tmp/gh-aw/issues-data/issues.json \ + || echo '[]' > /tmp/gh-aw/issues-data/issues.json echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json" echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)" diff --git a/.github/workflows/issue-arborist.md b/.github/workflows/issue-arborist.md index 40d4f183db..e61a107620 100644 --- a/.github/workflows/issue-arborist.md +++ b/.github/workflows/issue-arborist.md @@ -29,20 +29,41 @@ steps: - name: Fetch issues data env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_AW_ORIGINAL_GITHUB_API_URL: ${{ github.api_url }} run: | # Create output directory mkdir -p /tmp/gh-aw/issues-data echo "⬇ Downloading the last 100 open issues (excluding sub-issues)..." - # Fetch the last 100 open issues that don't have a parent issue - gh issue list --repo ${{ github.repository }} \ - --search "-parent-issue:*" \ - --state open \ - --json number,title,author,createdAt,state,url,body,labels,updatedAt,closedAt,milestone,assignees \ - --limit 100 \ - > /tmp/gh-aw/issues-data/issues.json + # Use REST API directly to avoid gh CLI /meta check blocked by DIFC proxy. + # Fetches the most recently created 100 issues (intentional limit matching previous behavior). + # State is normalized to uppercase (OPEN/CLOSED) to match gh CLI GraphQL output format. + curl -s \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + --get \ + --data-urlencode "q=repo:${{ github.repository }} is:issue is:open -is:sub-issue" \ + --data-urlencode "sort=created" \ + --data-urlencode "order=desc" \ + --data-urlencode "per_page=100" \ + "${GH_AW_ORIGINAL_GITHUB_API_URL}/search/issues" \ + | jq '.items // [] | map({ + number: .number, + title: .title, + author: {login: .user.login}, + createdAt: .created_at, + state: (.state | ascii_upcase), + url: .html_url, + body: .body, + labels: [.labels[] | {name: .name}], + updatedAt: .updated_at, + closedAt: .closed_at, + milestone: (if .milestone != null then {title: .milestone.title} else null end), + assignees: [.assignees[] | {login: .login}] + })' \ + > /tmp/gh-aw/issues-data/issues.json \ + || echo '[]' > /tmp/gh-aw/issues-data/issues.json echo "✓ Issues data saved to /tmp/gh-aw/issues-data/issues.json" echo "Total issues fetched: $(jq 'length' /tmp/gh-aw/issues-data/issues.json)"