Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add input for profile #31

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | `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 |
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ 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
default: ''

outputs:
version:
Expand Down Expand Up @@ -70,4 +74,7 @@ runs:
${{ inputs.release }} \
${{ inputs.git-user }} \
${{ inputs.git-user-email }} \
${{ inputs.verify }}
${{ inputs.verify }} \
${{ inputs.profile }}


10 changes: 8 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,13 @@ if [ "${CHECK}" = "true" ]; then
fi
fi

if [ "${RELEASE}" = "true" ]; then
cog bump --auto || exit 1
if [ "$RELEASE" = "true" ]; then
if [ "$PROFILE" != '' ]; then
echo "profile=${PROFILE}"
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