-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add automatic PR action --------- Co-authored-by: nicolaasuni-vonage <[email protected]>
- Loading branch information
1 parent
44a7db3
commit 99ad9a7
Showing
6 changed files
with
58 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Auto PR | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'autopr/**' | ||
|
||
jobs: | ||
create-pull-request: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Create PR | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const pulls = await github.rest.pulls.list({ | ||
owner: owner, | ||
repo: repo, | ||
head: context.ref, | ||
base: 'main', | ||
state: 'open', | ||
}); | ||
if (pulls.data.length < 1) { | ||
await github.rest.pulls.create({ | ||
title: '[AUTOPR] Automatic updates', | ||
owner: owner, | ||
repo: repo, | ||
head: context.ref, | ||
base: 'main', | ||
body: [ | ||
'This PR is auto-generated by', | ||
'[actions/github-script](https://github.com/actions/github-script)', | ||
].join('\n'), | ||
}); | ||
} else { | ||
const existingPR = pulls.data[0]; | ||
await github.rest.pulls.update({ | ||
owner: owner, | ||
repo: repo, | ||
pull_number: existingPR.number, | ||
body: [ | ||
existingPR.body, | ||
`Updated by Job ${context.job}`, | ||
].join('\n'), | ||
}); | ||
} |
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 +1 @@ | ||
1.78.0 | ||
1.78.1 |
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
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
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
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