From fa8feb816ed8a95d01799888d96fe7c3a33347df Mon Sep 17 00:00:00 2001 From: Adam Short Date: Fri, 25 Aug 2023 16:46:55 +0100 Subject: [PATCH 1/4] Add release branch as an input --- action.yml | 5 +++++ version-increment.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/action.yml b/action.yml index 8a9bff9..d973031 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,10 @@ inputs: Not applicable to `calver` scheme required: false default: 'patch' + release_branch: + description: "Specify a non-main branch to use for the release tag (the one without -prerelease). If empty, will use the default branch for the repo." + required: + type: string outputs: current-version: @@ -75,3 +79,4 @@ runs: increment: ${{ inputs.increment }} pep440: ${{ inputs.pep440 }} scheme: ${{ inputs.scheme }} + release_branch: ${{ inputs.release_branch }} diff --git a/version-increment.sh b/version-increment.sh index e3ac75d..b128562 100755 --- a/version-increment.sh +++ b/version-increment.sh @@ -32,6 +32,11 @@ default_branch='main' if [[ -z "${BATS_VERSION:-}" ]] ; then default_branch="$(git remote show origin | ${grep} 'HEAD branch' | cut -d ' ' -f 5)" fi +# use release_branch if not empty +if [[ -n "${release_branch}" ]] ; then + default_branch="${release_branch}" +fi + current_ref="${GITHUB_REF:-}" git_commit="$(git rev-parse --short HEAD | sed 's/0*//')" # trim leading zeros, because semver doesn't allow that in # the 'pre-release version' part, but we can't use the + char From 8202de88853fb264c6cc1610599253e0b092a11e Mon Sep 17 00:00:00 2001 From: Adam Short Date: Wed, 30 Aug 2023 11:17:54 +0100 Subject: [PATCH 2/4] Give action unique name. --- README.md | 3 +++ action.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d35199e..d476272 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +Forked from https://github.com/reecetech/version-increment. Likely only here until additional changes made in this fork are accepted back in the main repository. + + # ➕ Version Increment ## 📄 Use diff --git a/action.yml b/action.yml index d973031..d1bf837 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ --- -name: 'Version Increment' +name: 'Version Increment (Octo)' description: Inspects the git tags to determine the current normal version, and returns the next version number branding: From 47e175a7475103b56df5eb157b4fb035a42b9aa5 Mon Sep 17 00:00:00 2001 From: adamshortev <118197472+adamshortev@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:48:14 +0100 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Chris Bennett <110393183+oev-chrisbennett@users.noreply.github.com> --- README.md | 3 --- action.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index d476272..d35199e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -Forked from https://github.com/reecetech/version-increment. Likely only here until additional changes made in this fork are accepted back in the main repository. - - # ➕ Version Increment ## 📄 Use diff --git a/action.yml b/action.yml index d1bf837..d973031 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ --- -name: 'Version Increment (Octo)' +name: 'Version Increment' description: Inspects the git tags to determine the current normal version, and returns the next version number branding: From 67d70b45a4b155221b47ea00cf8ae0887bfdd0bf Mon Sep 17 00:00:00 2001 From: Adam Short Date: Tue, 5 Sep 2023 10:15:26 +0100 Subject: [PATCH 4/4] Specify "release_branch" is not required --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d973031..d280373 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: default: 'patch' release_branch: description: "Specify a non-main branch to use for the release tag (the one without -prerelease). If empty, will use the default branch for the repo." - required: + required: false type: string outputs: