Skip to content

Introduce another version we support #1027

Introduce another version we support

Introduce another version we support #1027

name: Validate Pre-Commit
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version-file: 'go.mod'
# check-latest: true
# cache: true
# - uses: robinraju/[email protected]
# with:
# repository: hashicorp/terraform-plugin-docs
# tag: "v0.13.0"
# fileName: "tfplugindocs_0.13.0_linux_amd64.zip"
# tarBall: false
# zipBall: false
# - name: Unzip
# run: |
# cd $GITHUB_WORKSPACE
# unzip -o tfplugindocs_0.13.0_linux_amd64.zip -d .
# - name: Validate Pre-Commit
# run: make ci-verify
rebuilddocs:
name: Generate docs
runs-on: ubuntu-latest
# needs: build
# if: failure()
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- uses: robinraju/[email protected]
with:
repository: hashicorp/terraform-plugin-docs
tag: "v0.13.0"
fileName: "tfplugindocs_0.13.0_linux_amd64.zip"
tarBall: false
zipBall: false
- name: Unzip
run: |
cd $GITHUB_WORKSPACE
unzip -o tfplugindocs_0.13.0_linux_amd64.zip -d .
- name: Run pre commit
run: |
make ci-pre-commit
git config --global user.name 'do87'
git config --global user.email '[email protected]'
git add docs/**
# Check if any files were added
if git diff --cached --name-only | grep -qE '.'; then
echo "Files added successfully."
else
echo "No files added. Exiting."
exit 0
fi
git commit -m "Automated docs update"
git push || true