Skip to content

Commit

Permalink
♻️ Make messages compatible with conventional commits (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47 committed Jan 10, 2023
1 parent f64a5cf commit bd5425a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
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

0 comments on commit bd5425a

Please sign in to comment.