Skip to content

Adding git-sub-dir #160

Adding git-sub-dir

Adding git-sub-dir #160

Workflow file for this run

name: ci
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Build Docker image
run: |
VERSION=$(grep "docker://quay.io/terraform-docs/gh-actions" action.yml | cut -d: -f4 | sed 's/"//g')
docker build --pull --tag quay.io/terraform-docs/gh-actions:${VERSION} .
- name: Should generate USAGE.md for tf11_basic
uses: ./
with:
working-dir: examples/tf11_basic
output-file: USAGE.md
template: |-
<!-- BEGIN_TF_DOCS -->
# Test tf11 basic
## Verify
Should use the template defined instead of the default
Should inject the table under usage
# Usage
{{ .Content }}
<!-- END_TF_DOCS -->
indention: 3
- name: Should generate USAGE.md for tf11_extra_args
uses: ./
with:
working-dir: examples/tf11_extra_args
output-format: markdown document
output-file: USAGE.md
output-method: replace
args: --sensitive=false --hide requirements --required=false
indention: 3
- name: Should generate README.md for tf12_bsic
uses: ./
with:
working-dir: examples/tf12_basic
indention: 3
- name: Should generate README.md for tf12_atlantis
uses: ./
with:
atlantis-file: atlantis.yaml
args: --hide providers
indention: 3
- name: Should generate USAGE.md for tf12_find and its submodules
uses: ./
with:
find-dir: examples/tf12_find
output-file: USAGE.md
- name: Should generate USAGE.md for tf12_find and its submodules recursively
uses: ./
with:
working-dir: examples/tf12_find
output-file: USAGE.md
recursive: true
recursive-path: modules
- name: Should generate README.md for tf12_config
uses: ./
with:
working-dir: examples/tf12_config
config-file: .terraform-docs.yml
- name: Should generate README.md for tf12_inject and push up all changes
uses: ./
with:
working-dir: examples/tf12_inject
args: --sort-by required
indention: 3
git-push: true
git-push-sign-off: true
git-commit-message: "terraform-docs: automated action"
- name: Should generate README.md for tf12_fail_diff and fail on diff
uses: ./
with:
working-dir: examples/tf12_fail_diff
indention: 3
fail-on-diff: true
format:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Terraform format
uses: hashicorp/setup-terraform@v3
with:
terraform_version: '0.12.17'
- run: terraform fmt examples