From a487a5bdc8d889d5923c6540465e05a27b4df764 Mon Sep 17 00:00:00 2001 From: Jonathan Cornaz Date: Mon, 17 Jan 2022 19:58:55 +0100 Subject: [PATCH] feat: add extra-files input (#410) --- README.md | 25 +++++++++++++++++++++++++ action.yml | 4 ++++ dist/index.js | 2 ++ index.js | 2 ++ 4 files changed, 33 insertions(+) diff --git a/README.md b/README.md index 13bada0..7775b6d 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Automate releases with Conventional Commit Messages. | `monorepo-tags` | add prefix to tags and branches, allowing multiple libraries to be released from the same repository. | | `changelog-types` | A JSON formatted String containing to override the outputted changelog sections | | `version-file` | provide a path to a version file to increment (used by ruby releaser) | +| `extra-files` | add extra-files to bump using the [generic updater](https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files) | | `fork` | Should the PR be created from a fork. Default `false`| | `command` | release-please command to run, either `github-release`, or `release-pr`, `manifest`, `manifest-pr` (_defaults to running both_) | | `default-branch` | branch to open pull release PR against (detected by default) | @@ -271,6 +272,30 @@ jobs: git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} ``` +## Adding additional files + +You can update additional files with the `extra-files` input. + +See the [generic updater docs](https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files) for more info on how release-please will update those files. + +```yaml +on: + push: + branches: + - main +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v3 + with: + release-type: node + extra-files: | + README.md + docs/getting-started.md +``` + ## License Apache Version 2.0 diff --git a/action.yml b/action.yml index fba42e9..e014a32 100644 --- a/action.yml +++ b/action.yml @@ -44,6 +44,10 @@ inputs: description: 'provide a path to a version file to increment (used by ruby releaser)' required: false default: '' + extra-files: + description: 'extra files to bump using the generic updater' + required: false + default: '' default-branch: description: 'branch to open pull release PR against (detected by default)' required: false diff --git a/dist/index.js b/dist/index.js index 5b7b20b..06f8454 100644 --- a/dist/index.js +++ b/dist/index.js @@ -77,6 +77,7 @@ async function main () { const changelogTypes = core.getInput('changelog-types') || undefined const changelogSections = changelogTypes && JSON.parse(changelogTypes) const versionFile = core.getInput('version-file') || undefined + const extraFiles = core.getMultilineInput('extra-files') || undefined const github = await getGitHubInstance() const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined const draft = core.getBooleanInput('draft') @@ -92,6 +93,7 @@ async function main () { changelogPath, changelogSections, versionFile, + extraFiles, includeComponentInTag: monorepoTags, pullRequestTitlePattern, draftPullRequest diff --git a/index.js b/index.js index 575398e..d2b7fa8 100644 --- a/index.js +++ b/index.js @@ -70,6 +70,7 @@ async function main () { const changelogTypes = core.getInput('changelog-types') || undefined const changelogSections = changelogTypes && JSON.parse(changelogTypes) const versionFile = core.getInput('version-file') || undefined + const extraFiles = core.getMultilineInput('extra-files') || undefined const github = await getGitHubInstance() const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined const draft = core.getBooleanInput('draft') @@ -85,6 +86,7 @@ async function main () { changelogPath, changelogSections, versionFile, + extraFiles, includeComponentInTag: monorepoTags, pullRequestTitlePattern, draftPullRequest