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 working_directory input #90

Merged
merged 2 commits into from
Nov 6, 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
| Name | Description | Default |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. Required if `push: true` | - |
| `working_directory` | Change to this directory before running | repo root directory |
| `dry_run` | Run without creating commit, output to stdout | false |
| `repository` | Repository name to push. Default or empty value represents current github repository | current one |
| `branch` | Destination branch to push changes | Same as the one executing the action by default |
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ outputs:
version:
description: 'New version'
inputs:
working_directory:
description: 'Change to this directory before running'
required: false
dry_run:
description: 'Run without creating commit, output to stdout'
required: false
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ echo "${PIP_CMD[@]}"
"${PIP_CMD[@]}"
echo "Commitizen version: $(cz version)"

if [[ $INPUT_WORKING_DIRECTORY ]]; then
cd $INPUT_WORKING_DIRECTORY
fi

PREV_REV="$(cz version --project)"
echo "PREVIOUS_REVISION=${PREV_REV}" >>"$GITHUB_ENV"

Expand Down
Loading