Skip to content

Sign documentation commits #114

Sign documentation commits

Sign documentation commits #114

Workflow file for this run

# Auto-generate documentation and commit changes to PRs
name: Docs
on:
pull_request:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
generate:
name: Generate and commit
runs-on: ubuntu-latest
# Only run on PRs from the same repo (not forks) to allow pushing
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
with:
terraform_wrapper: false
- name: Run make generate
run: make generate
- name: Check for changes
id: changes
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20
with:
commit_message: |
chore: auto-generate documentation
This commit was automatically generated by the CI pipeline.
Run 'make generate' locally to regenerate documentation.
repo: ${{ github.repository }}
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}