Skip to content

Commit b5bb5e2

Browse files
authored
Add support for disabling git tag creation (#34)
1 parent 7225f97 commit b5bb5e2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with: # All of theses inputs are optional
2525
tag_name: "v%s"
2626
tag_message: "v%s"
27+
create_tag: "true"
2728
commit_pattern: "^Release (\\S+)"
2829
workspace: "."
2930
publish_command: "yarn"
@@ -41,6 +42,7 @@ These inputs are optional: that means that if you don't enter them, default valu
4142

4243
- `tag_name`: the name pattern of the new tag
4344
- `tag_message`: the message pattern of the new tag
45+
- `create_tag`: whether to create a git tag or not (defaults to `"true"`)
4446
- `commit_pattern`: pattern that the commit message needs to follow
4547
- `workspace`: custom workspace directory that contains the `package.json` file
4648
- `publish_command`: custom publish command (defaults to `yarn`)

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ async function main() {
1616
const commitPattern =
1717
getEnv("COMMIT_PATTERN") || "^(?:Release|Version) (\\S+)";
1818

19+
const createTagFlag = getEnv("CREATE_TAG") !== "false";
20+
1921
const publishCommand = getEnv("PUBLISH_COMMAND") || "yarn";
2022
const publishArgs = arrayEnv("PUBLISH_ARGS");
2123

2224
const { name, email } = eventObj.repository.owner;
2325

2426
const config = {
2527
commitPattern,
28+
createTag: createTagFlag,
2629
tagName: placeholderEnv("TAG_NAME", "v%s"),
2730
tagMessage: placeholderEnv("TAG_MESSAGE", "v%s"),
2831
tagAuthor: { name, email },
@@ -69,7 +72,10 @@ async function processDirectory(dir, config, commits) {
6972

7073
checkCommit(config, commits, version);
7174

72-
await createTag(dir, config, version);
75+
if (config.createTag) {
76+
await createTag(dir, config, version);
77+
}
78+
7379
await publishPackage(dir, config, version);
7480

7581
console.log("Done.");

0 commit comments

Comments
 (0)