From 61d93941dc881149890ffbfc5c281cb2ff6db746 Mon Sep 17 00:00:00 2001 From: ErwannLeRoux Date: Fri, 21 Jul 2023 15:03:46 +0200 Subject: [PATCH] chore: automatic rebase tests --- .github/workflows/automatic-rebase.yml | 57 ++++++++++++++------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/automatic-rebase.yml b/.github/workflows/automatic-rebase.yml index 4c23a07..1500a4a 100644 --- a/.github/workflows/automatic-rebase.yml +++ b/.github/workflows/automatic-rebase.yml @@ -1,31 +1,36 @@ name: Automatic rebase on: - workflow_dispatch: ~ - push: - branches: - - master + workflow_dispatch: ~ + push: + branches: + - master jobs: - rebase: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - const query = `query($owner:String!, $name:String!, $labels:[String!]) { - repository(owner:$owner, name:$name){ - pullRequests(labels: $labels, first: 50) { - nodes { - headRefName - } - } - } - }`; - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - labels: ['Module'] - } - const result = await github.graphql(query, variables) - console.log(result.data.repository.pullRequests.nodes) + rebase: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + const query = `query($owner:String!, $name:String!, $labels:[String!]) { + repository(owner:$owner, name:$name){ + pullRequests(labels: $labels, first: 50) { + nodes { + headRefName + } + } + } + }`; + + const variables = { + owner: context.repo.owner, + name: context.repo.repo, + labels: ['Module'] + } + + const result = await github.graphql(query, variables) + const branches = result.repository.pullRequests.nodes.map(node => node.headRefName) + - name: gh test + run: | + gh pr list --label Module --limit 50