Skip to content

Commit

Permalink
feat(profile): add bump profile input
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejomon committed Oct 31, 2024
1 parent 5ae1660 commit fe5fa94
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `[email protected]`|
| 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 | `[email protected]` |
| `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 |
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -70,4 +73,7 @@ runs:
${{ inputs.release }} \
${{ inputs.git-user }} \
${{ inputs.git-user-email }} \
${{ inputs.verify }}
${{ inputs.verify }} \
${{ inputs.profile }}
9 changes: 7 additions & 2 deletions cog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit fe5fa94

Please sign in to comment.