Skip to content

Commit

Permalink
Clean up Git commit ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallroth committed Feb 26, 2022
1 parent 96b020e commit b1e7d3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gridsome.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ function slugify(text) {

module.exports = function (api) {
api.loadSource(({ addMetadata }) => {
const gitCommit = process.env.COMMIT_REF
? process.env.COMMIT_REF.slice(0, 7)
: "N/A";

addMetadata("site", siteMetadata);
addMetadata("gitCommit", process.env.COMMIT_REF ?? "N/A");
addMetadata("gitCommit", gitCommit);
});

api.loadSource((actions) => {
Expand Down

0 comments on commit b1e7d3e

Please sign in to comment.