From fe5fa94e7bdc975f4f324d15fee14e279fb90043 Mon Sep 17 00:00:00 2001 From: Guillaume Gayot Date: Wed, 30 Oct 2024 18:23:04 +0100 Subject: [PATCH] feat(profile): add bump profile input --- README.md | 16 +++++++++------- action.yml | 8 +++++++- cog.sh | 9 +++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 774c989..feb65c8 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,12 @@ Once the step is finished cocogitto's binary will be available in your path. Here are all the inputs available through `with`: -| Input | Description | Default | -| ------------------- | -------------------------------------------------------------------------- | ------- | -| `check` | Check conventional commit compliance with `cog check` | `true` | -| `check-latest-tag-only` | Check conventional commit compliance with `cog check --from-latest-tag` | `false` | -| `release` | Perform a release using `cog bump --auto` | `false` | -| `git-user` | Set the git `user.name` to use for the release commit | `cog-bot`| -| `git-user-email` | Set the git `user.email` to use for the release commit | `cog@demo.org`| +| Input | Description | Default | +|-------------------------|--------------------------------------------------------------------------------------------------|----------------| +| `check` | Check conventional commit compliance with `cog check` | `true` | +| `check-latest-tag-only` | Check conventional commit compliance with `cog check --from-latest-tag` | `false` | +| `release` | Perform a release using `cog bump --auto` | `false` | +| `git-user` | Set the git `user.name` to use for the release commit | `cog-bot` | +| `git-user-email` | Set the git `user.email` to use for the release commit | `cog@demo.org` | +| `verify` | Check a string input against the conventional commit specification but do not create any commit. | `false` | +| `profile` | Specify the bump profil to use for release | null | diff --git a/action.yml b/action.yml index eda8275..18b95d1 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,9 @@ inputs: commit specification but do not create any commit. required: false default: 'false' + profile: + description: Specify the bump profil to use for release + required: false outputs: version: @@ -70,4 +73,7 @@ runs: ${{ inputs.release }} \ ${{ inputs.git-user }} \ ${{ inputs.git-user-email }} \ - ${{ inputs.verify }} + ${{ inputs.verify }} \ + ${{ inputs.profile }} + + diff --git a/cog.sh b/cog.sh index add915f..1cec52b 100755 --- a/cog.sh +++ b/cog.sh @@ -8,6 +8,7 @@ RELEASE="${3}" GIT_USER="${4}" GIT_USER_EMAIL="${5}" VERIFY="${6}" +PROFILE="${7}" echo "Setting git user : ${GIT_USER}" git config --global user.name "${GIT_USER}" @@ -32,8 +33,12 @@ if [ "${CHECK}" = "true" ]; then fi fi -if [ "${RELEASE}" = "true" ]; then - cog bump --auto || exit 1 +if [ "$RELEASE" = "true" ]; then + if [ "$PROFILE" != null ]; then + cog bump --auto -H $PROFILE || exit 1 + else + cog bump --auto || exit 1 + fi VERSION="$(git describe --tags "$(git rev-list --tags --max-count=1)")" echo "version=$VERSION" >> $GITHUB_OUTPUT fi