Skip to content

Merge pull request #1454 from sandydoo/fix-doc-commit #2950

Merge pull request #1454 from sandydoo/fix-doc-commit

Merge pull request #1454 from sandydoo/fix-doc-commit #2950

Workflow file for this run

name: "Generate docs/examples"
on:
push:
pull_request:
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@V28
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: devenv
- run: nix profile install . -L --accept-flake-config
- name: Generate doc options
run: devenv shell devenv-generate-doc-options
- uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
default_author: github_actions
add: docs/reference/options.md
message: 'Auto generate docs/reference/options.md'
- name: Verify individual docs
run: devenv shell devenv-verify-individual-docs
- uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
default_author: github_actions
message: 'Auto generate missing individual markdowns'
- name: Generate docs and supported-languages example
run: |
devenv shell devenv-generate-docs
devenv shell devenv-generate-languages-example
devenv shell devenv-generate-individual-docs
- uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
default_author: github_actions
add: docs examples/supported-languages/devenv.nix
message: 'Auto generate docs and examples'
- name: Generate JSON schema
run: devenv generate-json-schema
- uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
default_author: github_actions
add: docs/devenv.schema.json
message: 'Auto generate docs/devenv.schema.json'
- name: Check for uncommitted changes
run: |
diff=$(git diff --stat)
if [[ -n "$diff" ]]; then
message="There are uncommitted doc changes in the repository.
${diff}
To resolve this, you can:
a. Run the failing devenv-generate-* commands locally and commit the changes.
b. Let CI auto-commit the changes to your fork of the repo. You may need to enable this workflow on your fork."
echo "::error::${message//$'\n'/%0A}"
exit 1
else
echo "No uncommitted doc changes found."
fi