Skip to content

Commit

Permalink
Add notice for existing pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Mar 10, 2022
1 parent dff2362 commit 2d48cf4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/sync-rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,23 @@ jobs:
script: |
const repo = process.env.TARGET_REPO_FULLNAME.split('/')[1]
return (
const existingPr = (
await github.paginate(github.rest.issues.listForRepo, {
owner: "exercism",
repo: repo,
state: 'open',
})
).some((pr) =>
).find((pr) =>
pr.body && pr.body.includes(process.env.TRACKING_ISSUE_URL)
)
if (existingPr) {
console.log(`::notice::Existing pull request found: ${existingPr.html_url}`)
return true
}
return false
############################################################
# ONLY RUN THE REST OF THE SCRIPT IF THE PR DOES NOT EXIST #
# All following steps must have: #
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,23 @@ jobs:
script: |
const repo = process.env.TARGET_REPO_FULLNAME.split('/')[1]
return (
const existingPr = (
await github.paginate(github.rest.issues.listForRepo, {
owner: "exercism",
repo: repo,
state: 'open',
})
).some((pr) =>
).find((pr) =>
pr.body && pr.body.includes(process.env.TRACKING_ISSUE_URL)
)
if (existingPr) {
console.log(`::notice::Existing pull request found: ${existingPr.html_url}`)
return true
}
return false
############################################################
# ONLY RUN THE REST OF THE SCRIPT IF THE PR DOES NOT EXIST #
# All following steps must have: #
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sync-tracks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,23 @@ jobs:
script: |
const repo = process.env.TARGET_REPO_FULLNAME.split('/')[1]
return (
const existingPr = (
await github.paginate(github.rest.issues.listForRepo, {
owner: "exercism",
repo: repo,
state: 'open',
})
).some((pr) =>
).find((pr) =>
pr.body && pr.body.includes(process.env.TRACKING_ISSUE_URL)
)
if (existingPr) {
console.log(`::notice::Existing pull request found: ${existingPr.html_url}`)
return true
}
return false
############################################################
# ONLY RUN THE REST OF THE SCRIPT IF THE PR DOES NOT EXIST #
# All following steps must have: #
Expand Down

0 comments on commit 2d48cf4

Please sign in to comment.