Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Jan 19, 2022
1 parent 6c824d7 commit 66b83c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,10 @@ function action(_actionName, params, core) {
return __awaiter(this, void 0, void 0, function* () {
core.debug(JSON.stringify(params));
const { owner, repo } = 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 npm_or_yarn = yield node_fetch_1.default(urlJoin("https://raw.github.com", owner, repo, branch, "yarn.lock")).then(res => res.status === 404 ? "npm" : "yarn");
core.debug(`Version on ${owner}/${repo}#${branch} is using ${npm_or_yarn}`);
return { npm_or_yarn };
Expand Down Expand Up @@ -9168,7 +9171,10 @@ function action(_actionName, params, core) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
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\//, "");
core.debug(`params: ${JSON.stringify(params)}`);
const exclude_commit_from_author_names = JSON.parse(params.exclude_commit_from_author_names_json);
const octokit = createOctokit_1.createOctokit({ github_token });
Expand Down
5 changes: 4 additions & 1 deletion src/tell_if_project_uses_npm_or_yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export async function action(

const { owner, repo } = 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 npm_or_yarn = await fetch(
urlJoin(
Expand Down
5 changes: 4 additions & 1 deletion src/update_changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export async function action(
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\//, "");

core.debug(`params: ${JSON.stringify(params)}`);

Expand Down

0 comments on commit 66b83c9

Please sign in to comment.