Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add custom commit message #1136

Merged
merged 5 commits into from
Dec 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions v1/lib/publish-gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const GITHUB_DOMAIN = 'github.com';
// For GitHub enterprise, allow specifying a different host.
const GITHUB_HOST =
process.env.GITHUB_HOST || siteConfig.githubHost || GITHUB_DOMAIN;
const CUSTOM_COMMIT_MESSAGE = process.env.CUSTOM_COMMIT_MESSAGE;

if (!ORGANIZATION_NAME) {
shell.echo(
Expand Down Expand Up @@ -165,9 +166,10 @@ fs.copy(

shell.cd(path.join('build', `${PROJECT_NAME}-${DEPLOYMENT_BRANCH}`));
shell.exec('git add --all');


const commitMessage = CUSTOM_COMMIT_MESSAGE ? CUSTOM_COMMIT_MESSAGE : 'Deploy website'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const commitMessage = CUSTOM_COMMIT_MESSAGE || 'Deploy website' 

const commitResults = shell.exec(
`git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"`,
`git commit -m "${commitMessage}" -m "Deploy website version based on ${currentCommit}"`,
);
if (shell.exec(`git push origin ${DEPLOYMENT_BRANCH}`).code !== 0) {
shell.echo('Error: Git push failed');
Expand Down