Skip to content

Generate terraform docs #192

Generate terraform docs

Generate terraform docs #192

Workflow file for this run

name: Generate terraform docs
on:
pull_request:
branches:
- main
paths-ignore:
- '.github/**/*'
- 'scripts/**/*'
workflow_dispatch:
permissions:
contents: write # Required to update documentation in the repo
pull-requests: write
jobs:
tf-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Render terraform docs for microsoft365_provider
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/microsoft365_provider
indention: 3
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
- name: Render terraform docs for microsoft365_graph
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/
recursive: true
recursive-path: microsoft365_graph/
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
args: "--terraform-docs-version 0.19.0"
- name: Render terraform docs for microsoft365_graph_beta
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/
recursive: true
recursive-path: microsoft365_graph_beta/
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
args: "--terraform-docs-version 0.19.0"
go-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Generate Go Docs
run: go generate ./...
- name: Check for changes in generated Go docs
id: go-gen-check
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes in Go docs
if: steps.go-gen-check.outputs.changes == 'true'
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: "go generate: automated update"
file_pattern: '**/*.go'
commit_options: '--no-verify --signoff'
commit_user_name: "GitHub Actions Bot"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>"
status_options: '--untracked-files=no'
add_options: '-u'
push_options: '--force'
skip_dirty_check: false
skip_fetch: true
skip_checkout: true