Add change log generator #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TF Docs | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/shakir85/tf-tools:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Run Git Setup | |
uses: ./.github/actions/setup-git | |
with: | |
repo-path: /__w/Terraform-Modules/Terraform-Modules | |
- name: Fetch latest changes | |
run: | | |
git fetch origin ${{ github.head_ref }} | |
git pull origin ${{ github.head_ref }} | |
- name: Generate VM Module Docs | |
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/vm | |
- name: Generate LX Module Docs | |
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/lxc | |
- name: Generate Cloud-Image Module Docs | |
run: terraform-docs markdown table --output-file README.md --output-mode inject ./proxmox/get-cloud-image | |
- name: Commit changes | |
run: | | |
git add -A | |
git commit -m "chore: update Terraform docs [skip ci]" || echo "No changes to commit" | |
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git ${{ github.head_ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |