diff --git a/lib/publish-gh-pages.js b/lib/publish-gh-pages.js index 2eb8748ab8..44131b1384 100755 --- a/lib/publish-gh-pages.js +++ b/lib/publish-gh-pages.js @@ -84,6 +84,9 @@ if (shell.exec(`node ${path.join(__dirname, 'build-files.js')}`).code) { shell.exit(1); } +// Save the commit hash that triggers publish-gh-pages before checking out to deployment branch +const currentCommit = shell.exec('git rev-parse HEAD').stdout.trim(); + shell.cd(process.cwd()); shell.cd('build'); @@ -154,9 +157,6 @@ fs.copy( } shell.cd(path.join('build', `${PROJECT_NAME}-${DEPLOYMENT_BRANCH}`)); - - const currentCommit = shell.exec('git rev-parse HEAD').stdout.trim(); - shell.exec('git add --all'); const commitResults = shell.exec(