Skip to content

Commit afd1f2d

Browse files
committed
Update working version
1 parent 5ccb7ca commit afd1f2d

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

.github/workflows/incrementVersionAndCreatePR.cjs

+10-15
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = async ({ github, context, versionType }) => {
2323
}
2424

2525
async function getPull(source, target) {
26-
const existingPr = await github.rest.pulls.list({
26+
const existingPr = await github.pulls.list({
2727
owner: context.repo.owner,
2828
repo: context.repo.repo,
2929
head: source,
@@ -33,19 +33,14 @@ module.exports = async ({ github, context, versionType }) => {
3333
}
3434

3535
async function createPull(title, source, target) {
36-
try {
37-
await github.pulls.create({
38-
title,
39-
body: `${title} PR.`,
40-
owner: context.repo.owner,
41-
repo: context.repo.repo,
42-
head: source,
43-
base: target,
44-
});
45-
console.log(`Created pull request: ${title}.`);
46-
} catch (error) {
47-
console.error(error.errors);
48-
}
36+
await github.pulls.create({
37+
title,
38+
body: `${title} PR.`,
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
head: source,
42+
base: target,
43+
});
4944
}
5045

5146
try {
@@ -65,6 +60,6 @@ module.exports = async ({ github, context, versionType }) => {
6560
throw new Error("Pull request already exists for this version increment");
6661
}
6762
} catch (error) {
68-
throw new Error("Error in version increment and PR creation:", error);
63+
throw new Error("Error in version increment and PR creation", error);
6964
}
7065
};

0 commit comments

Comments
 (0)