From 19431a1126b0d092093511e4d9074add51d1e9e1 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 1 Dec 2023 11:37:56 -0800 Subject: [PATCH] fix: restore include-component-in-tag default (false) (#888) v3 had this option and must be configurable or at least set to `false` so that the default behavior is to create a plain `v1.2.3` tag (without the component name prefixed). Found this while dogfooding our own usage of the action (in this repo). --- README.md | 1 + action.yml | 3 +++ dist/index.js | 2 ++ src/index.ts | 3 +++ 4 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 2e7631f..6eabde6 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ steps: | `github-api-url` | Override the GitHub API URL. | | `github-graphql-url` | Override the GitHub GraphQL URL | | `fork` | If `true`, send the PR from a fork. This requires the `token` to be a user that can create forks (e.g. not the default `GITHUB_TOKEN`) | +| `include-component-in-tag` | If true, add prefix to tags and branches, allowing multiple libraries to be released from the same repository | | `proxy-server` | Configure a proxy servier in the form of `:` e.g. `proxy-host.com:8080` | | `skip-github-release` | If `true`, do not attempt to create releases. This is useful if splitting release tagging from PR creation. | | `skip-github-pull-request` | If `true`, do not attempt to create release pull requests. This is useful if splitting release tagging from PR creation. | diff --git a/action.yml b/action.yml index cb35d8b..eeb48a4 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,9 @@ inputs: description: 'If true, send the PR from a fork. This requires the token to be a user that can create forks (e.g. not the default GITHUB_TOKEN)' required: false default: false + include-component-in-tag: + description: 'If true, add prefix to tags and branches, allowing multiple libraries to be released from the same repository' + required: false proxy-server: description: 'set proxy sever when you run this action behind a proxy. format is host:port e.g. proxy-host.com:8080' required: false diff --git a/dist/index.js b/dist/index.js index ecc8b6b..8435b60 100644 --- a/dist/index.js +++ b/dist/index.js @@ -116242,6 +116242,7 @@ function parseInputs() { skipGitHubRelease: getOptionalBooleanInput('skip-github-release'), skipGitHubPullRequest: getOptionalBooleanInput('skip-github-pull-request'), fork: getOptionalBooleanInput('fork'), + includeComponentInTag: getOptionalBooleanInput('include-component-in-tag'), }; return inputs; } @@ -116260,6 +116261,7 @@ function loadOrBuildManifest(github, inputs) { core.debug('Building manifest from config'); return release_please_1.Manifest.fromConfig(github, github.repository.defaultBranch, { releaseType: inputs.releaseType, + includeComponentInTag: inputs.includeComponentInTag, }, { fork: inputs.fork, }, inputs.path); diff --git a/src/index.ts b/src/index.ts index 8f3975b..549a987 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,6 +39,7 @@ interface ActionInputs { skipGitHubRelease?: boolean; skipGitHubPullRequest?: boolean; fork?: boolean; + includeComponentInTag?: boolean; } // TODO: replace this interface is exported from release-please @@ -86,6 +87,7 @@ function parseInputs(): ActionInputs { skipGitHubRelease: getOptionalBooleanInput('skip-github-release'), skipGitHubPullRequest: getOptionalBooleanInput('skip-github-pull-request'), fork: getOptionalBooleanInput('fork'), + includeComponentInTag: getOptionalBooleanInput('include-component-in-tag'), }; return inputs; } @@ -113,6 +115,7 @@ function loadOrBuildManifest( github.repository.defaultBranch, { releaseType: inputs.releaseType, + includeComponentInTag: inputs.includeComponentInTag, }, { fork: inputs.fork,