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 47
47
[ "$(git config user.name)" = "Ansible Documentation Bot" ]
48
48
[ "$(git config user.email)" = "${adb_email}" ]
49
49
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:
13
13
description : " Name of the committer (user.name)"
14
14
global :
15
15
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 : " ."
16
19
runs :
17
20
using : composite
18
21
steps :
22
25
INPUT_BOT : " ${{ inputs.bot }}"
23
26
INPUT_NAME : " ${{ inputs.name || inputs.bot }}"
24
27
INPUT_GLOBAL : " ${{ inputs.global }}"
28
+ INPUT_WORKING_DIRECTORY : " ${{ inputs.working-directory }}"
25
29
SCRIPT : " ${{ github.action_path }}/set_bot_user.sh"
26
30
run : |
27
31
set -euo pipefail
31
35
if [[ "${INPUT_GLOBAL}" =~ (true|1) ]]; then
32
36
args+=("--global")
33
37
fi
38
+ cd "${INPUT_WORKING_DIRECTORY}"
34
39
set -x
35
40
git config "${args[@]}" \
36
41
user.name "${INPUT_NAME}"
You can’t perform that action at this time.
0 commit comments