From 075642022a74a90ba51ce4109ce738c3d92a31c3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 04:58:58 +0000 Subject: [PATCH 1/2] Initial plan From fe4ba224f9505115148acc8eed843f381c40eefc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 05:08:29 +0000 Subject: [PATCH 2/2] Fix PR Migration Notice workflow to not require approval Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com> Agent-Logs-Url: https://github.com/alphaonelabs/website/sessions/22750446-3791-4cdd-82d7-43191cfa4b1d --- .github/workflows/pr-migration-notice.yml | 40 ++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-migration-notice.yml b/.github/workflows/pr-migration-notice.yml index d8a8b3101..2c9fd433c 100644 --- a/.github/workflows/pr-migration-notice.yml +++ b/.github/workflows/pr-migration-notice.yml @@ -1,25 +1,57 @@ name: PR Migration Notice on: - pull_request_target: - types: [opened] + workflow_run: + workflows: ["Test"] + types: [requested] permissions: pull-requests: write + issues: write jobs: notify-and-close: runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' steps: - name: Post migration notice and close PR uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const pr = context.payload.pull_request; + const workflowRun = context.payload.workflow_run; + const headBranch = workflowRun.head_branch; + const headOwner = workflowRun.head_repository.owner.login; + const repo = context.repo; + + // Find the open PR associated with this workflow run. + // The pull_requests array is empty for fork PRs, so we search by head. + let prs; + try { + ({ data: prs } = await github.rest.pulls.list({ + owner: repo.owner, + repo: repo.repo, + state: 'open', + head: `${headOwner}:${headBranch}`, + })); + } catch (err) { + console.error(`Failed to list pull requests: ${err.message}`); + return; + } + + if (prs.length === 0) { + console.log('No open PRs found for this workflow run.'); + return; + } + + if (prs.length > 1) { + console.log(`Found ${prs.length} open PRs for ${headOwner}:${headBranch}; using the most recently updated one.`); + prs.sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at)); + } + + const pr = prs[0]; const prNumber = pr.number; const prAuthor = pr.user.login; - const repo = context.repo; const message = `## 🚚 This Repository Is Moving\n\n` +