gh-actions icon indicating copy to clipboard operation
gh-actions copied to clipboard

How to exclude a folder in current working directory for TFDOCS

Open vara-bonthu opened this issue 4 years ago • 0 comments

What problem are you facing?

I am using this workflow to update Terraform Readme with Docs. My module contains number of folders under root including some examples.

My folder structure as follows. I would like to run this workflow only for modules folder and the root folder where main.tf file is located.

  |--designs
  |--examples
  |--modules
      |--mod1 
      |--mod2
  |--main.tf
  |--variables.tf

here is my workflow example

     - uses: actions/checkout@v2
        if: ${{ (github.event.pull_request.head.repo.full_name == github.repository) && (github.event_name == 'pull_request') }}
        with:
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.ref }}
          repository: ${{github.event.pull_request.head.repo.full_name}}

     - name: Render terraform docs inside the README.md and push changes back to PR branch
        uses: terraform-docs/[email protected]
        if: github.event.pull_request.head.repo.full_name == github.repository
        with:
          find-dir: .
          output-file: README.md
          output-method: inject
          git-push: "true"

How could terraform-docs help solve your problem?

vara-bonthu avatar Feb 16 '22 12:02 vara-bonthu