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

🐛 Make messages compatible with Conventional Commits #290

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ You can specify a custom commit body. This will be appended to the commit messag

The above example would result in a commit message that looks something like this:
```
🔄 Synced local '<filename>' with remote '<filename>'
🔄 synced local '<filename>' with remote '<filename>'
Change-type: patch
```
Expand All @@ -476,7 +476,7 @@ You can add more content to the PR body with the `PR_BODY` option. For example:
It will be added below the first line of the body and above the list of changed files. The above example would result in a PR body that looks something like this:

```
Synced local file(s) with GITHUB_REPOSITORY.
synced local file(s) with GITHUB_REPOSITORY.
This is your custom PR Body
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default class Git {
}

async commit(msg) {
let message = msg !== undefined ? msg : `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }`
let message = msg !== undefined ? msg : `${ COMMIT_PREFIX } synced file(s) with ${ GITHUB_REPOSITORY }`
if (COMMIT_BODY) {
message += `\n\n${ COMMIT_BODY }`
}
Expand Down Expand Up @@ -421,7 +421,7 @@ export default class Git {

async createOrUpdatePr(changedFiles, title) {
const body = dedent(`
Synced local file(s) with [${ GITHUB_REPOSITORY }](https://github.com/${ GITHUB_REPOSITORY }).
synced local file(s) with [${ GITHUB_REPOSITORY }](https://github.com/${ GITHUB_REPOSITORY }).

${ PR_BODY }

Expand All @@ -438,7 +438,7 @@ export default class Git {
const { data } = await this.github.pulls.update({
owner: this.repo.user,
repo: this.repo.name,
title: `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }`,
title: `${ COMMIT_PREFIX } synced file(s) with ${ GITHUB_REPOSITORY }`,
pull_number: this.existingPr.number,
body: body
})
Expand All @@ -451,7 +451,7 @@ export default class Git {
const { data } = await this.github.pulls.create({
owner: this.repo.user,
repo: this.repo.name,
title: title === undefined ? `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }` : title,
title: title === undefined ? `${ COMMIT_PREFIX } synced file(s) with ${ GITHUB_REPOSITORY }` : title,
body: body,
head: `${ FORK ? FORK : this.repo.user }:${ this.prBranch }`,
base: this.baseBranch
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ async function run() {

const message = {
true: {
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } Synced local '${ file.dest }' with remote '${ file.source }'`,
pr: `Synced local ${ directory } <code>${ file.dest }</code> with remote ${ directory } <code>${ file.source }</code>`
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } synced local '${ file.dest }' with remote '${ file.source }'`,
pr: `synced local ${ directory } <code>${ file.dest }</code> with remote ${ directory } <code>${ file.source }</code>`
},
false: {
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } Created local '${ file.dest }' from remote '${ file.source }'`,
pr: `Created local ${ directory } <code>${ file.dest }</code> ${ otherFiles } from remote ${ directory } <code>${ file.source }</code>`
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } created local '${ file.dest }' from remote '${ file.source }'`,
pr: `created local ${ directory } <code>${ file.dest }</code> ${ otherFiles } from remote ${ directory } <code>${ file.source }</code>`
}
}

Expand Down