Merge pull request #10 from ssoerensen/master

Added dry_run option
This commit is contained in:
Mathieu Dutour 2020-03-28 21:01:05 +01:00 committed by GitHub
commit 61723be3c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -28,6 +28,7 @@ jobs:
- **tag_prefix** _(optional)_ - A prefix to the tag name (default: `v`).
- **release_branches** _(optional)_ - Comma separated list of branches (bash reg exp accepted) that will generate the release tags. Other branches and pull-requests generate versions postfixed with the commit hash and do not generate any tag. Examples: `master` or `.*` or `release.*,hotfix.*,master`... (default: `master`).
- **create_annotated_tag** _(optional)_ - Boolean to create an annotated rather than a lightweight one (default: `false`).
- **dry_run** _(optional)_ - Do not perform taging, just calculate next version and changelog, then exit
### Outputs

View File

@ -26,6 +26,11 @@ inputs:
description: "Boolean to create an annotated tag rather than lightweight"
required: false
default: false
dry_run:
description: "Do not perform taging, just calculate next version and changelog, then exit"
required: false
default: false
runs:
using: "node12"
main: "lib/main.js"

View File

@ -1,6 +1,6 @@
{
"name": "github-tag-action",
"version": "4.0.0",
"version": "4.1.0",
"private": true,
"description": "A Github Action to automatically bump and tag master, on merge, with the latest SemVer formatted version.",
"main": "lib/main.js",

View File

@ -46,6 +46,7 @@ async function run() {
const tagPrefix = core.getInput("tag_prefix");
const releaseBranches = core.getInput("release_branches");
const createAnnotatedTag = core.getInput("create_annotated_tag");
const dryRun = core.getInput("dry_run");
const { GITHUB_REF, GITHUB_SHA } = process.env;
@ -146,6 +147,11 @@ async function run() {
return;
}
if (dryRun) {
core.info("Dry run: not performing tag action.");
return;
}
const octokit = new GitHub(core.getInput("github_token"));
if (createAnnotatedTag === "true") {