From b1e7d3e08ef4201e92771ebd7c021ba423e14cc0 Mon Sep 17 00:00:00 2001 From: Kendall Roth Date: Sat, 26 Feb 2022 12:21:48 -0500 Subject: [PATCH] Clean up Git commit ref --- gridsome.server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gridsome.server.js b/gridsome.server.js index 82766c4..1854922 100644 --- a/gridsome.server.js +++ b/gridsome.server.js @@ -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) => {