File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 4747 [ "$(git config user.name)" = "Ansible Documentation Bot" ]
4848 [ "$(git config user.email)" = "${adb_email}" ]
4949 done
50+ git config --global --unset user.name
51+ git config --global --unset user.email
52+
53+
54+ - name : " 3. Run complex case with working-directory"
55+ uses : ./
56+ with :
57+ working-directory : ./test
58+ - name : " 3. Check complex case with working-directory"
59+ run : |
60+ cd test
61+ [ "$(git config user.name)" = "github-actions" ]
62+ [ "$(git config user.email)" = "${gha_email}" ]
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ inputs:
1313 description : " Name of the committer (user.name)"
1414 global :
1515 description : " Whether to set the config globally or only for the current repo"
16+ working-directory :
17+ description : " Directory in which to run commands"
18+ default : " ."
1619runs :
1720 using : composite
1821 steps :
2225 INPUT_BOT : " ${{ inputs.bot }}"
2326 INPUT_NAME : " ${{ inputs.name || inputs.bot }}"
2427 INPUT_GLOBAL : " ${{ inputs.global }}"
28+ INPUT_WORKING_DIRECTORY : " ${{ inputs.working-directory }}"
2529 SCRIPT : " ${{ github.action_path }}/set_bot_user.sh"
2630 run : |
2731 set -euo pipefail
3135 if [[ "${INPUT_GLOBAL}" =~ (true|1) ]]; then
3236 args+=("--global")
3337 fi
38+ cd "${INPUT_WORKING_DIRECTORY}"
3439 set -x
3540 git config "${args[@]}" \
3641 user.name "${INPUT_NAME}"
You can’t perform that action at this time.
0 commit comments