-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (35 loc) · 1.11 KB
/
bump-sources-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
on:
push:
branches: [ bump-sources ]
jobs:
check-create-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const response = await github.graphql(
`query {
repository(owner: "risicle", name:"nix-build-task") {
pullRequests(headRefName: "bump-sources", first: 1, states: OPEN) {
nodes {
number
}
}
}
}`
);
if (response.repository.pullRequests.nodes.length == 0) {
github.pulls.create({
owner: "risicle",
repo: "nix-build-task",
head: "bump-sources",
base: "master",
title: "Bump sources",
body: `
This is an automated pull request.
This bump to nix-build-task's pinned sources results in a new build hash, and should probably be applied.
`
});
}