Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/npm-f4e71bc59b
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela authored Dec 26, 2023
2 parents 8715127 + 6c5f1b1 commit d565358
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/modules/createCommit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async (message) => {
return false;
}
if (!upstream) {
console.info("Running in github actions, but HEAD is not tracking any remote branch, exit.");
console.info("Running in github actions, but HEAD does not point to a branch, exit.");
return false;
}
console.info("[createCommit] Running in github actions, try to create commit.");
Expand Down
9 changes: 7 additions & 2 deletions scripts/modules/getUpstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ if (!isInGithubActions) {
process.exit(0);
}
/**
* @type { string | false } when false, it means the current branch is not tracking any remote branch.
* @type { string | false } when false, it means the current branch does not point to a branch.
*/
let result;
try {
result = await git.revparse(["--abbrev-ref", "--symbolic-full-name", "@{upstream}"]);
console.info("[getUpstream]", "upstream:", result);
} catch (e) {
console.error(e);
if (e?.message?.includes("HEAD does not point to a branch")) {
console.info("[getUpstream]", "HEAD does not point to a branch.");
} else {
console.error("[getUpstream]", "Unexpected error:", e);
}
result = false;
}
export default result;
2 changes: 1 addition & 1 deletion scripts/postCommit/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (!isInGithubActions) {
process.exit(0);
}
if (!upstream) {
console.info("Running in github actions, but HEAD is not tracking any remote branch, exit.");
console.info("Running in github actions, but HEAD does not point to a branch, exit.");
process.exit(0);
}
const GITHUB_EVENT = await readWorkflowEvent();
Expand Down

0 comments on commit d565358

Please sign in to comment.