Skip to content

Commit

Permalink
🔖 Release v1.14.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
BetaHuhnBot committed Sep 27, 2021
1 parent 8c50c0d commit 98b4980
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [v1.14.0] - 2021-09-27

[Release notes](https://github.com/betahuhn/repo-file-sync-action/releases/tag/v1.14.0) · [Compare](https://github.com/betahuhn/repo-file-sync-action/compare/v1.13.5...v1.14.0) · [Tag](https://github.com/betahuhn/repo-file-sync-action/tree/v1.14.0) · Archive ([zip](https://github.com/betahuhn/repo-file-sync-action/archive/v1.14.0.zip) · [tar.gz](https://github.com/betahuhn/repo-file-sync-action/archive/v1.14.0.tar.gz))

### New features

- [`8c50c0d`](https://github.com/betahuhn/repo-file-sync-action/commit/8c50c0d) Add COMMIT_AS_PR_TITLE option (#115)
(Issues: [`#115`](https://github.com/betahuhn/repo-file-sync-action/issues/115) [`#103`](https://github.com/betahuhn/repo-file-sync-action/issues/103))

## [v1.13.5] - 2021-09-23

[Release notes](https://github.com/betahuhn/repo-file-sync-action/releases/tag/v1.13.5) · [Compare](https://github.com/betahuhn/repo-file-sync-action/compare/v1.13.4...v1.13.5) · [Tag](https://github.com/betahuhn/repo-file-sync-action/tree/v1.13.5) · Archive ([zip](https://github.com/betahuhn/repo-file-sync-action/archive/v1.13.5.zip) · [tar.gz](https://github.com/betahuhn/repo-file-sync-action/archive/v1.13.5.tar.gz))
Expand Down
27 changes: 20 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16827,6 +16827,11 @@ try {
type: 'boolean',
default: false
}),
COMMIT_AS_PR_TITLE: getInput({
key: 'COMMIT_AS_PR_TITLE',
type: 'boolean',
default: false
}),
BRANCH_PREFIX: getInput({
key: 'BRANCH_PREFIX',
default: 'repo-sync/SOURCE_REPO_NAME'
Expand Down Expand Up @@ -17218,7 +17223,7 @@ class Git {
})
}

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

Expand All @@ -17237,6 +17242,7 @@ 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 }`,
pull_number: this.existingPr.number,
body: body
})
Expand All @@ -17249,7 +17255,7 @@ class Git {
const { data } = await this.github.pulls.create({
owner: this.repo.user,
repo: this.repo.name,
title: `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }`,
title: title === undefined ? `${ COMMIT_PREFIX } Synced file(s) with ${ GITHUB_REPOSITORY }` : title,
body: body,
head: this.prBranch,
base: this.baseBranch
Expand Down Expand Up @@ -17592,7 +17598,8 @@ const {
SKIP_CLEANUP,
OVERWRITE_EXISTING_PR,
SKIP_PR,
ORIGINAL_MESSAGE
ORIGINAL_MESSAGE,
COMMIT_AS_PR_TITLE
} = __nccwpck_require__(4570)

const run = async () => {
Expand Down Expand Up @@ -17678,7 +17685,9 @@ const run = async () => {
modified.push({
dest: file.dest,
source: file.source,
message: message[destExists].pr
message: message[destExists].pr,
useOriginalMessage: useOriginalCommitMessage,
commitMessage: message[destExists].commit
})
}
})
Expand Down Expand Up @@ -17714,9 +17723,12 @@ const run = async () => {
})
}

await git.commit(useOriginalCommitMessage ? git.originalCommitMessage() : undefined)
const commitMessage = useOriginalCommitMessage ? git.originalCommitMessage() : undefined
await git.commit(commitMessage)
modified.push({
dest: git.workingDir
dest: git.workingDir,
useOriginalMessage: useOriginalCommitMessage,
commitMessage: commitMessage
})
}

Expand All @@ -17734,7 +17746,8 @@ const run = async () => {
</details>
`)

const pullRequest = await git.createOrUpdatePr(COMMIT_EACH_FILE ? changedFiles : '')
const useCommitAsPRTitle = COMMIT_AS_PR_TITLE && modified.length === 1 && modified[0].useOriginalMessage
const pullRequest = await git.createOrUpdatePr(COMMIT_EACH_FILE ? changedFiles : '', useCommitAsPRTitle ? modified[0].commitMessage.split('\n', 1)[0].trim() : undefined)

core.notice(`Pull Request #${ pullRequest.number } created/updated: ${ pullRequest.html_url }`)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "repo-file-sync-action",
"version": "1.13.5",
"version": "1.14.0",
"description": "GitHub Action to keep files like Action workflows or entire directories in sync between multiple repositories.",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 98b4980

Please sign in to comment.