File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ inputs:
74
74
description : If true it will sign-off commit
75
75
required : false
76
76
default : " false"
77
+ git-sub-dir :
78
+ description : Subdirectory that terraform code is checked out into
79
+ required : false
80
+ default : " "
77
81
fail-on-diff :
78
82
description : Fail the job if there is any diff found between the generated output and existing file (ignored if `git-push` is set)
79
83
required : false
@@ -85,7 +89,7 @@ outputs:
85
89
86
90
runs :
87
91
using : docker
88
- image : " docker://quay.io/terraform-docs/gh-actions:1.2.0 "
92
+ image : " docker://quay.io/terraform-docs/gh-actions:1.2.1 "
89
93
env :
90
94
INPUT_WORKING_DIR : ${{ inputs.working-dir }}
91
95
INPUT_ATLANTIS_FILE : ${{ inputs.atlantis-file }}
@@ -105,6 +109,7 @@ runs:
105
109
INPUT_GIT_PUSH_SIGN_OFF : ${{ inputs.git-push-sign-off }}
106
110
INPUT_GIT_PUSH_USER_NAME : ${{ inputs.git-push-user-name }}
107
111
INPUT_GIT_PUSH_USER_EMAIL : ${{ inputs.git-push-user-email }}
112
+ INPUT_GIT_SUB_DIR : ${{ inputs.git-sub-dir }}
108
113
109
114
branding :
110
115
icon : file-text
Original file line number Diff line number Diff line change @@ -48,11 +48,16 @@ if [ -z "${INPUT_GIT_PUSH_USER_EMAIL}" ]; then
48
48
INPUT_GIT_PUSH_USER_EMAIL=" github-actions[bot]@users.noreply.github.com"
49
49
fi
50
50
51
+ if [ -n " ${INPUT_GIT_SUB_DIR} " ]; then
52
+ GITHUB_WORKSPACE=" ${GITHUB_WORKSPACE} /${INPUT_GIT_SUB_DIR} "
53
+ echo " Using non-standard GITHUB_WORKSPACE of ${GITHUB_WORKSPACE} "
54
+ fi
55
+
51
56
git_setup () {
52
57
# When the runner maps the $GITHUB_WORKSPACE mount, it is owned by the runner
53
58
# user while the created folders are owned by the container user, causing this
54
59
# error. Issue description here: https://github.com/actions/checkout/issues/766
55
- git config --global --add safe.directory /github/workspace
60
+ git config --global --add safe.directory ${GITHUB_WORKSPACE}
56
61
57
62
git config --global user.name " ${INPUT_GIT_PUSH_USER_NAME} "
58
63
git config --global user.email " ${INPUT_GIT_PUSH_USER_EMAIL} "
You can’t perform that action at this time.
0 commit comments