Fix is package json version upgraded when branch name contains slashes

This commit is contained in:
garronej 2022-01-19 00:34:13 +01:00
parent 331734f7ee
commit efe9b73716
2 changed files with 8 additions and 2 deletions

View file

@ -34,7 +34,10 @@ export async function action(
const { owner, repo, github_token } = params;
const branch = params.branch.split("/").reverse()[0];
//params.branch <- github.head_ref || github.ref
//When it's a normal branch: github.head_ref==="" and github.ref==="refs/heads/main"
//When it's a pr from: github.head_ref==="<name of the branch branch>"
const branch = params.branch.replace(/^refs\/heads\//, "");
const to_version = await getPackageJsonVersion({ owner, repo, branch });