Skip to content

Commit

Permalink
feat(nx-ghpages): add option to customize commit message to gh-pages (
Browse files Browse the repository at this point in the history
#542)

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
  • Loading branch information
tinesoft and AgentEnder authored Oct 18, 2022
1 parent 374e30f commit cff00e0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# NxDotnet

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![Join the chat at https://gitter.im/nx-dotnet-plugin/community](https://badges.gitter.im/nx-dotnet-plugin/community.svg)](https://gitter.im/nx-dotnet-plugin/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Run CI checks](https://github.com/nx-dotnet/nx-dotnet/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/nx-dotnet/nx-dotnet/actions/workflows/main.yml)
Expand Down
4 changes: 4 additions & 0 deletions docs/nx-ghpages/executors/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ Deploy a page to a specified repository&#39;s gh-pages branch.
### remoteName

- (string): Name of the remote to push to

### commitMessage

- (string): Message of the git commit to gh-pages branch
1 change: 1 addition & 0 deletions packages/nx-ghpages/src/executors/deploy/executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const options: BuildExecutorSchema = {
directory: '',
remote: '',
remoteName: '',
commitMessage: '',
};

describe('Build Executor', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/nx-ghpages/src/executors/deploy/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default async function deployExecutor(options: BuildExecutorSchema) {
logger.info('Authoring Commit');

await exec(`git add .`, { cwd: directory });
await exec(` git commit -m "deploy to gh-pages (nx-ghpages)"`, {
await exec(` git commit -m "${options.commitMessage}"`, {
cwd: directory,
});

Expand Down
1 change: 1 addition & 0 deletions packages/nx-ghpages/src/executors/deploy/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface BuildExecutorSchema {
remote: string;
directory: string;
remoteName: string;
commitMessage: string;
}
5 changes: 5 additions & 0 deletions packages/nx-ghpages/src/executors/deploy/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"type": "string",
"description": "Name of the remote to push to",
"default": "origin"
},
"commitMessage": {
"type": "string",
"description": "Message of the git commit to gh-pages branch",
"default": "chore: :rocket: deploy new version to Github Pages"
}
},
"required": ["remote", "directory"]
Expand Down

0 comments on commit cff00e0

Please sign in to comment.