Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file completely ignored #136

Open
tedivm opened this issue Jun 26, 2024 · 3 comments
Open

Configuration file completely ignored #136

tedivm opened this issue Jun 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tedivm
Copy link

tedivm commented Jun 26, 2024

Describe the bug

When using this action I would expect the configuration file for the project to be used.

Instead this action passes in values via the command line flags, which overwrite the configuration file values.

How can we reproduce it?

Create a configuration file, use the action, and watch it be ignored.

Environment information

Github Actions with the latest version of the action.

@tedivm tedivm added the bug Something isn't working label Jun 26, 2024
@kieran-lowe
Copy link

noticed this as well, comparing the output from my run and it seems to be completely ignoring it.

@g--
Copy link

g-- commented Dec 2, 2024

I found this in the debug output:

terraform-docs markdown table --config .terraform-docs.yml --output-mode inject --output-file README.md --output-template <!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS --> .

it looks like it is passing in the configuration file, but it's also specifying the default values of several other parameters.

I'm guessing one solution would be to not set the parameters unless GHA receives an explicit argument. This would have the effect of making terraform-docs' defaults this GHA's defaults.

@g--
Copy link

g-- commented Dec 3, 2024

Here's a work-around: set the values with defaults explicitly to the empty string, like this:

    - name: Render terraform module docs
      uses: terraform-docs/gh-actions@main
      id: check
      with:
        working-dir: .
        config-file: .terraform-docs.yml

        # set values to blank so it uses the config file
        output-method:
        output-file:
        output-format:
        template: 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants