Skip to content

Commit

Permalink
Merge pull request #90 from arman1371/feat/add-working-directory
Browse files Browse the repository at this point in the history
feat: add `working_directory` input
  • Loading branch information
woile authored Nov 6, 2024
2 parents 1f11eb2 + ee70294 commit 23bc292
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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

0 comments on commit 23bc292

Please sign in to comment.