From 108c10b32aa03efa5f71af6a233dc2e8e32845cb Mon Sep 17 00:00:00 2001 From: Rohith Reddy <5032439+brandedoutcast@users.noreply.github.com> Date: Tue, 14 Jul 2020 12:07:33 +0530 Subject: [PATCH] fix #38 by respecting spaces around version tag --- README.md | 4 ++-- action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1132ffe..7f46d67 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ jobs: # VERSION_FILE_PATH: Directory.Build.props # Regex pattern to extract version info in a capturing group - # VERSION_REGEX: (.*)<\/Version> + # VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX # VERSION_STATIC: 1.0.0 @@ -67,7 +67,7 @@ Input | Default Value | Description PROJECT_FILE_PATH | | Filepath of the project to be packaged, relative to root of repository PACKAGE_NAME | | NuGet package id, used for version detection & defaults to project name VERSION_FILE_PATH | `[PROJECT_FILE_PATH]` | Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH -VERSION_REGEX | `(.*)<\/Version>` | Regex pattern to extract version info in a capturing group +VERSION_REGEX | `^\s*(.*)<\/Version>\s*$` | Regex pattern to extract version info in a capturing group VERSION_STATIC| | Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX TAG_COMMIT | `true` | Flag to toggle git tagging, enabled by default TAG_FORMAT | `v*` | Format of the git tag, `[*]` gets replaced with actual version diff --git a/action.yml b/action.yml index 7d06a1d..9dc71b2 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: VERSION_REGEX: description: Regex pattern to extract version info in a capturing group required: false - default: ^(.*)<\/Version>$ + default: ^\s*(.*)<\/Version>\s*$ VERSION_STATIC: description: Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX required: false