Skip to content

Commit 535d36d

Browse files
authored
Create graphql.yml
1 parent d16c77d commit 535d36d

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/graphql.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Auto Start CI
2+
3+
on:
4+
schedule:
5+
# Runs every five minutes (fastest the scheduler can run). Five minutes is
6+
# optimistic, it can take longer to run.
7+
# To understand why `schedule` is used instead of other events, refer to
8+
# ./doc/guides/commit-queue.md
9+
- cron: '*/5 * * * *'
10+
11+
env:
12+
NODE_VERSION: lts/*
13+
14+
jobs:
15+
startCI:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set variables
21+
run: |
22+
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
23+
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
24+
25+
# Get Pull Requests
26+
- name: Get Pull Requests
27+
uses: octokit/graphql-action@v2
28+
id: get_prs_for_ci
29+
with:
30+
query: |
31+
query prs($owner:String!, $repo:String!) {
32+
repository(owner:$owner, name:$repo) {
33+
pullRequests(labels: ["request-ci"], states: OPEN, last: 100) {
34+
nodes { number }
35+
}
36+
}
37+
}
38+
owner: ${{ env.OWNER }}
39+
repo: ${{ env.REPOSITORY }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- run: echo '${{ toJSON(steps.get_prs_for_ci.outputs.data) }}'
44+

0 commit comments

Comments
 (0)