Skip to content

Commit

Permalink
don't fail checks if a PR already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Oct 27, 2021
1 parent 870ddf9 commit 941fd03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ function run() {
if (!!error.errors && !!error.errors[0] && !!error.errors[0].message && error.errors[0].message.startsWith('No commits between')) {
console.log('No commits between ' + context.repo.owner + ':' + base + ' and ' + owner + ':' + head);
}
else if (!!error.errors && !!error.errors[0] && !!error.errors[0].message && error.errors[0].message.startsWith('A pull request already exists for')) {
// we were already done
console.log(error.errors[0].message);
}
else {
if (!ignoreFail) {
core.setFailed(`Failed to create or merge pull request: ${error !== null && error !== void 0 ? error : "[n/a]"}`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fork-sync",
"version": "1.6.2",
"version": "1.6.3",
"private": true,
"description": "Keep your fork up to date",
"main": "lib/main.js",
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ async function run() {
}
if (!!error.errors && !!error.errors[0] && !!error.errors[0].message && error.errors[0].message.startsWith('No commits between')) {
console.log('No commits between ' + context.repo.owner + ':' + base + ' and ' + owner + ':' + head);
} else if (!!error.errors && !!error.errors[0] && !!error.errors[0].message && error.errors[0].message.startsWith('A pull request already exists for')) {
// we were already done
console.log(error.errors[0].message);
} else {
if (!ignoreFail) {
core.setFailed(`Failed to create or merge pull request: ${error ?? "[n/a]"}`);
Expand Down

0 comments on commit 941fd03

Please sign in to comment.