diff --git a/README.md b/README.md index 8082ab0..952eaa2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ Add the following step at the end of your job. # Optional glob pattern of files which should be added to the commit file_pattern: src/\*.js + + # Optional repository path + repository: . + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` diff --git a/action.yml b/action.yml index 9ce27e3..9fd2826 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,10 @@ inputs: description: File pattern used for "git add" required: false default: '.' + repository: + description: Path to repository + required: false + default: '.' runs: using: 'docker' @@ -26,6 +30,7 @@ runs: - ${{ inputs.commit_options }} - ${{ inputs.branch }} - ${{ inputs.file_pattern }} + - ${{ inputs.repository }} branding: icon: 'git-commit' diff --git a/entrypoint.sh b/entrypoint.sh index 3cd73ed..a84b2f9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,10 @@ EOF git config --global user.name "GitHub Actions" } +echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY"; + +cd $INPUT_REPOSITORY + # This section only runs if there have been file changes echo "Checking for uncommitted changes in the git working tree." if [[ -n "$(git status -s)" ]]