-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa1ab42
commit cbaa177
Showing
1 changed file
with
36 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,41 @@ | ||
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)) | ||
branches.forEach(b => { | ||
}) | ||
- | ||
name: gh test | ||
run: | | ||
gh pr list --label Module --limit 50 |