Skip to content

Commit bd5425a

Browse files
authored
♻️ Make messages compatible with conventional commits (#290)
1 parent f64a5cf commit bd5425a

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ You can specify a custom commit body. This will be appended to the commit messag
454454

455455
The above example would result in a commit message that looks something like this:
456456
```
457-
🔄 Synced local '<filename>' with remote '<filename>'
457+
🔄 synced local '<filename>' with remote '<filename>'
458458
459459
Change-type: patch
460460
```
@@ -476,7 +476,7 @@ You can add more content to the PR body with the `PR_BODY` option. For example:
476476
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:
477477

478478
```
479-
Synced local file(s) with GITHUB_REPOSITORY.
479+
synced local file(s) with GITHUB_REPOSITORY.
480480
481481
This is your custom PR Body
482482

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/git.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export default class Git {
228228
}
229229

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

422422
async createOrUpdatePr(changedFiles, title) {
423423
const body = dedent(`
424-
Synced local file(s) with [${ GITHUB_REPOSITORY }](https://github.com/${ GITHUB_REPOSITORY }).
424+
synced local file(s) with [${ GITHUB_REPOSITORY }](https://github.com/${ GITHUB_REPOSITORY }).
425425
426426
${ PR_BODY }
427427
@@ -438,7 +438,7 @@ export default class Git {
438438
const { data } = await this.github.pulls.update({
439439
owner: this.repo.user,
440440
repo: this.repo.name,
441-
title: `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }`,
441+
title: `${ COMMIT_PREFIX } synced file(s) with ${ GITHUB_REPOSITORY }`,
442442
pull_number: this.existingPr.number,
443443
body: body
444444
})
@@ -451,7 +451,7 @@ export default class Git {
451451
const { data } = await this.github.pulls.create({
452452
owner: this.repo.user,
453453
repo: this.repo.name,
454-
title: title === undefined ? `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }` : title,
454+
title: title === undefined ? `${ COMMIT_PREFIX } synced file(s) with ${ GITHUB_REPOSITORY }` : title,
455455
body: body,
456456
head: `${ FORK ? FORK : this.repo.user }:${ this.prBranch }`,
457457
base: this.baseBranch

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ async function run() {
9393

9494
const message = {
9595
true: {
96-
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } Synced local '${ file.dest }' with remote '${ file.source }'`,
97-
pr: `Synced local ${ directory } <code>${ file.dest }</code> with remote ${ directory } <code>${ file.source }</code>`
96+
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } synced local '${ file.dest }' with remote '${ file.source }'`,
97+
pr: `synced local ${ directory } <code>${ file.dest }</code> with remote ${ directory } <code>${ file.source }</code>`
9898
},
9999
false: {
100-
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } Created local '${ file.dest }' from remote '${ file.source }'`,
101-
pr: `Created local ${ directory } <code>${ file.dest }</code> ${ otherFiles } from remote ${ directory } <code>${ file.source }</code>`
100+
commit: useOriginalCommitMessage ? git.originalCommitMessage() : `${ COMMIT_PREFIX } created local '${ file.dest }' from remote '${ file.source }'`,
101+
pr: `created local ${ directory } <code>${ file.dest }</code> ${ otherFiles } from remote ${ directory } <code>${ file.source }</code>`
102102
}
103103
}
104104

0 commit comments

Comments
 (0)