Skip to content

Commit

Permalink
Automerge let me down
Browse files Browse the repository at this point in the history
(removed broken and superfluous code block)

Former-commit-id: ecb82fb
  • Loading branch information
josh-heyer authored Aug 9, 2021
1 parent 0a73e72 commit 3accf4b
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,6 @@ const gitData = (() => {
return { branch, sha };
})();

const currentBranchName = (() => {
// if this build was triggered by a GH action in response to a PR,
// use the head ref (the branch that someone is requesting be merged)
let branch = process.env.GITHUB_HEAD_REF;
// if this process was otherwise triggered by a GH action, use the current branch name
if (!branch) branch = process.env.GITHUB_REF;
// non-GH Action build? Try actually running Git for the name...
if (!branch) {
try {
branch = execSync("git rev-parse --abbrev-ref HEAD").toString();
} catch {}
}
if (!branch) branch = isProduction ? "main" : "develop";

return branch.replace(/^refs\/heads\//, "").replace(/^refs\/tags\//, "");
})();

exports.onCreateNode = async ({ node, getNode, actions, loadNodeContent }) => {
const { createNodeField } = actions;

Expand Down

0 comments on commit 3accf4b

Please sign in to comment.