From 1caeff86f772615c0e773d867a3adad6f38cd0f3 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 17 Aug 2026 12:41:07 -0500 Subject: [PATCH 1/3] ci: update report workflow for copilot assignment and content --- .../workflows/report-workflow-failures.yml | 56 +++++++++++++++---- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/report-workflow-failures.yml b/.github/workflows/report-workflow-failures.yml index 8c367668552..c81b623f134 100644 --- a/.github/workflows/report-workflow-failures.yml +++ b/.github/workflows/report-workflow-failures.yml @@ -21,6 +21,7 @@ jobs: issues: write steps: - name: Create or update issue + id: report uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | @@ -95,11 +96,26 @@ jobs: const body = [ issueMarker, + `*Generated by the [${context.workflow} workflow](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).*`, + '', 'The following jobs are failing in this workflow:', '', ...failedJobListItems, '', 'cc @github/primer-engineering to investigate and fix', + '', + '
', + 'Agent instructions', + '', + 'Investigate this workflow failure and determine whether it needs a change in this repository.', + '', + '- Review the failed jobs, their logs, and recent runs of the same workflow.', + '- Assess whether the failure is intermittent or caused by an external service disruption, outage, or other transient infrastructure issue.', + '- If the failure has an actionable cause in this repository, implement the smallest appropriate fix and verify it addresses the failure.', + '- Do not make speculative code changes when the evidence points to a transient or external cause.', + '- If you decide not to attempt a fix, leave a comment on this issue explaining the evidence and rationale for that decision.', + '', + '
', ].join('\n'); const issue = { @@ -133,18 +149,36 @@ jobs: issueNumber = createdIssue.data.number; } - try { - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - assignees: ['copilot'], - }); - } catch (error) { - core.warning( - `Failed to assign @copilot to issue #${issueNumber}. This is expected if Copilot assignment is not enabled for this repository. Error: ${error?.message ?? String(error)}`, - ); + core.setOutput('issue_number', issueNumber); + + - name: Assign issue to Copilot + if: ${{ steps.report.outputs.issue_number }} + env: + GH_TOKEN: ${{ secrets.GH_AW_AGENT_TOKEN }} + ISSUE_NUMBER: ${{ steps.report.outputs.issue_number }} + run: | + assigned="$( + gh api \ + --method POST \ + -H 'Accept: application/vnd.github+json' \ + -H 'X-GitHub-Api-Version: 2022-11-28' \ + "/repos/${GITHUB_REPOSITORY}/issues/${ISSUE_NUMBER}/assignees" \ + --input - \ + --jq 'any(.assignees[]; .login == "copilot-swe-agent[bot]")' < Date: Mon, 17 Aug 2026 12:45:15 -0500 Subject: [PATCH 2/3] ci: update issue type and labels --- .github/workflows/report-workflow-failures.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/report-workflow-failures.yml b/.github/workflows/report-workflow-failures.yml index c81b623f134..77a61db3d9d 100644 --- a/.github/workflows/report-workflow-failures.yml +++ b/.github/workflows/report-workflow-failures.yml @@ -123,6 +123,7 @@ jobs: repo: context.repo.repo, title, body, + type: 'Bug', }; let issueNumber; @@ -149,6 +150,13 @@ jobs: issueNumber = createdIssue.data.number; } + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + labels: ['area: actions'], + }); + core.setOutput('issue_number', issueNumber); - name: Assign issue to Copilot From 5dc1e3cb21806afa4f0fe7ba40bad633e5dc6b61 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 17 Aug 2026 15:50:16 -0500 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/report-workflow-failures.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/report-workflow-failures.yml b/.github/workflows/report-workflow-failures.yml index 77a61db3d9d..858cc0df09b 100644 --- a/.github/workflows/report-workflow-failures.yml +++ b/.github/workflows/report-workflow-failures.yml @@ -161,10 +161,10 @@ jobs: - name: Assign issue to Copilot if: ${{ steps.report.outputs.issue_number }} + continue-on-error: true env: GH_TOKEN: ${{ secrets.GH_AW_AGENT_TOKEN }} ISSUE_NUMBER: ${{ steps.report.outputs.issue_number }} - run: | assigned="$( gh api \ --method POST \