From e3ee48ec23ff63ba7a1dca156eb4abe9d12077f1 Mon Sep 17 00:00:00 2001 From: Jack Penson Date: Tue, 24 May 2022 09:10:44 +0100 Subject: [PATCH] TF Docs adds extra files on git_add when using working directory '.' When using TF Docs after other steps which contain lint actions for example which output additional files to the current working directory TF Docs will add those files. With the following configuration at the end of a workflow run I get additional files in my PRs. I believe this is because the `OUTPUT_FILES` variable is not defined. It appears it should be $INPUT_OUTPUT_FILE. To replicate, create a job which `touch`s some files and then runs this step. ``` - name: TF-Docs uses: terraform-docs/gh-actions@v1.0.0 with: working-dir: . output-file: README.md output-method: inject git-push: "true" ``` --- src/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docker-entrypoint.sh b/src/docker-entrypoint.sh index e287bb1..97c7896 100755 --- a/src/docker-entrypoint.sh +++ b/src/docker-entrypoint.sh @@ -142,7 +142,7 @@ update_doc() { fi if [ "${INPUT_OUTPUT_METHOD}" == "inject" ] || [ "${INPUT_OUTPUT_METHOD}" == "replace" ]; then - git_add "${working_dir}/${OUTPUT_FILE}" + git_add "${working_dir}/${INPUT_OUTPUT_FILE}" fi }