Skip to content

Commit

Permalink
TF Docs adds extra files on git_add when using working directory '.'
Browse files Browse the repository at this point in the history
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/[email protected]
      with:
        working-dir: .
        output-file: README.md
        output-method: inject
        git-push: "true"
```

Signed-off-by: Jack Penson <[email protected]>
  • Loading branch information
Penson122 committed May 24, 2022
1 parent 561fc05 commit 0ab34f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 0ab34f4

Please sign in to comment.