Skip to content

Commit 5d27765

Browse files
committed
Add comment input to allow/prevent version check comments
1 parent 66505b8 commit 5d27765

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ version is updated when new features are released.
112112
| ------------------ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
113113
| `allow-prerelease` | `'true'` | If `check-only` is `'true'`, this controls if the check should pass if a matching prerelease version is detected (e.g. `v1.0.0-SNAPSHOT`). |
114114
| `check-only` | `'false'` | If set to `'true'`, only checks if the version exists. Fails the action if the version already exists. |
115+
| `comment` | `'true'` | If set to `'true'`, a comment will be added to the pull request indicating if the version is valid or conflicts with an existing version. |
115116
| `manifest-path` | | The path to the manifest that contains the version (relative to the root of the repository). |
116117
| | | If not set, `use-version` must be set. |
117118
| `overwrite` | `'false'` | Set to `'true'` to overwrite existing tags. |

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ inputs:
1818
If set to 'true', the action will only check if the version exists and, if
1919
so, will fail. Defaults to 'false'.
2020
required: false
21+
comment:
22+
default: 'true'
23+
description:
24+
If set to 'true', the action will comment on the pull request indicating
25+
if the version is valid. Defaults to 'true'.
26+
required: false
2127
manifest-path:
2228
description:
2329
The path to the manifest file that contains the version information,

dist/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "issue-ops-semver",
33
"description": "Semantically version GitHub repository tags",
4-
"version": "2.3.2",
4+
"version": "2.4.0",
55
"type": "module",
66
"author": "Nick Alteen <ncalteen@github.com>",
77
"homepage": "https://github.com/issue-ops/semver#readme",

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export async function run() {
1212
const useVersion: string = core.getInput('use-version')
1313
const workspace: string = core.getInput('workspace')
1414
const push: boolean = core.getInput('push-tags') === 'true'
15+
const comment: boolean = core.getInput('comment') === 'true'
1516

1617
if (
1718
(manifestPath === '' && useVersion === '') ||
@@ -46,7 +47,8 @@ export async function run() {
4647
if (
4748
github.context.issue?.number !== undefined &&
4849
github.context.eventName === 'pull_request' &&
49-
github.context.payload?.action !== 'closed'
50+
github.context.payload?.action !== 'closed' &&
51+
comment
5052
)
5153
await versionCheckComment(!exists, manifestPath)
5254

0 commit comments

Comments
 (0)