message: Open one main-next pr
diff: @@ -11,9 +11,39 @@ env:
  EMAIL: banana-bot@outlook.com
  jobs:
  - dequeue:
  + check-pr:
  runs-on: ubuntu-latest
  if: github.repository_owner == 'microsoft'
  + steps:
  + - run: npm install @octokit/core
  + - name: Check PR exists using octokit
  + uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # pin@v6
  + id: check-pr-exists
  + with:
  + token: ${{ secrets.BOT_MAIN_NEXT_WORKFLOW_PAT }}
  + script: |
  + const { Octokit } = require("@octokit/core");
  + const token = `${{ secrets.GITHUB_TOKEN }}`;
  + const octokit = new Octokit({ auth: token });
  + const data = await octokit.request('GET /repos/{owner}/{repo}/pulls', {
  + owner: 'microsoft',
  + repo: 'FluidFramework'
  + });
  + console.log("data----", data);
  + console.log("items----", data.items);
  + console.log("length---", data.items.length);
  + for(let i=0; i<data.items.length; i++) {
  + if(data.items[i].title.startsWith('Automation: Main Next Integrate')) {
  + return true;
  + }
  + }
  + return false;
  + outputs:
  + EXISTS: ${{ steps.check-pr-exists.outputs.result }}
  + dequeue:
  + runs-on: ubuntu-latest
  + needs: [ check-pr-exists ]
  + if: needs.check-pr-exists.outputs.EXISTS == 'false'
  steps:
  - run: npm install @azure/storage-queue
  - uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # pin@v6
  @@ -93,8 +123,11 @@ jobs:
  const newPr = await octokit.request('POST /repos/{owner}/{repo}/pulls', {
  owner: 'microsoft',
  repo: 'FluidFramework',
  - title: 'Main Next Integrate',
  - body: 'This commit is queued for getting merged with the next branch. Please make sure to resolve any conflicts/CI failures seen on this PR. Thank you!',
  + title: 'Automation: Main Next Integrate',
  + body: 'The aim of this pull request is to sync main and next branch. The expectation from the assignee is as follows:
  + 1. Acknowledge the pull request by adding a comment -- "Actively working on it"
  + 2. Resolve any merge conflicts/CI failures see locally.
  + You can also find more information about how to resolve build failures and conflicts: https://github.com/microsoft/FluidFramework/wiki/Main-next-Automation',
  head: sha,
  base: 'next'
  });
  