Created a first draft of this action. #14
12
index.js
12
index.js
@ -48,22 +48,10 @@ async function getAndPostPullRequests() {
|
|||||||
// core.info(`GET repsonse ${JSON.stringify(pulls, 2)}`);
|
// core.info(`GET repsonse ${JSON.stringify(pulls, 2)}`);
|
||||||
|
|
||||||
// Logic to decide if a POST request is needed
|
// Logic to decide if a POST request is needed
|
||||||
core.info(branch);
|
|
||||||
core.info(base_branch);
|
|
||||||
const targetPRFound = _.any(
|
const targetPRFound = _.any(
|
||||||
pulls,
|
pulls,
|
||||||
(pr) => pr.head.ref === branch && pr.base.ref === base_branch,
|
(pr) => pr.head.ref === branch && pr.base.ref === base_branch,
|
||||||
);
|
);
|
||||||
for (let pr of pulls) {
|
|
||||||
core.info(branch);
|
|
||||||
core.info(base_branch);
|
|
||||||
|
|
||||||
core.info(pr.head.ref);
|
|
||||||
core.info(pr.base.ref);
|
|
||||||
core.info(pr.base.ref === base_branch);
|
|
||||||
core.info(pr.head.ref === branch);
|
|
||||||
core.info(pr.head.ref === branch && pr.base.ref === base_branch);
|
|
||||||
}
|
|
||||||
if (!targetPRFound) {
|
if (!targetPRFound) {
|
||||||
core.info(
|
core.info(
|
||||||
`No open pulls found, to merge ${branch} into ${base_branch}. Trying to create a new PR.`,
|
`No open pulls found, to merge ${branch} into ${base_branch}. Trying to create a new PR.`,
|
||||||
|
Reference in New Issue
Block a user