Bicep Documentation Compliance Check Workflow
Overview
The Bicep Documentation Compliance Check workflow validates documentation standards across the codebase to ensure all Bicep modules are properly documented and that documentation stays in sync with code changes. This workflow helps maintain accurate and consistent documentation across the codebase, improving usability and reducing onboarding time for new contributors.
Features
- Verifies that Bicep module documentation is current using a custom documentation generator
- Identifies and reports links containing language-specific paths (e.g., 'en-us') which may become outdated when documentation is updated for different languages
- Creates GitHub annotations for issues found
- Generates a summary report of findings
- Configurable failure behavior - can either raise warnings or fail the build
Inputs
| Input | Description | Required | Default |
|---|---|---|---|
break_build | Whether to fail the workflow on documentation issues | No | false |
Outputs
This workflow doesn't produce any output variables, but it:
- Creates GitHub annotations for any documentation issues found
- Adds warnings or errors to the workflow logs
- Generates a workflow summary of documentation checks performed
Usage Examples
Basic Validation (Warning Mode)
name: Check Bicep Documentation
uses: ./.github/workflows/docs-check-bicep.yml
with:
break_build: false
Strict Validation (Fail on Issues)
name: Validate Bicep Documentation
uses: ./.github/workflows/docs-check-bicep.yml
with:
break_build: true
Triggering Manually
The workflow can be triggered manually from the GitHub Actions tab with configurable parameters:
- Select the
Bicep Docs Checkworkflow - Click "Run workflow"
- Choose whether to break the build on documentation issues
- Click "Run workflow" again
Implementation Details
The workflow performs two main checks:
-
Bicep Documentation Freshness Check:
- Uses the
scripts/bicep-docs-check.shscript to verify that auto-generated documentation for Bicep modules is current - If documentation is outdated, provides instructions on how to regenerate it using
scripts/update-all-bicep-docs.sh
- Uses the
-
Language Path Segments Check:
- Uses the
scripts/link-lang-check.pyscript to detect URLs containing language-specific paths (e.g., 'en-us') - Reports any found issues with file and line number references
- These language paths can become outdated when documentation is updated for different languages
- Uses the
Workflow Steps
- Check out the repository code
- Set up Python 3.11 environment
- Install required Python dependencies
- Set up Azure CLI with Bicep support
- Run Bicep documentation freshness check
- Run link language path segment check
- Report any issues found as annotations and in workflow summary
Troubleshooting
Common Issues
-
"Bicep auto-gen documentation needs to be updated"
- Solution: Run
scripts/update-all-bicep-docs.shfrom the repository root, commit and push the changes
- Solution: Run
-
"Found URLs with language path segments (en-us)"
- Solution: Update the URLs in your documentation to remove language-specific paths. For example, change:
https://learn.microsoft.com/azure/documentationtohttps://learn.microsoft.com/azure/documentation
- Solution: Update the URLs in your documentation to remove language-specific paths. For example, change:
-
"Error parsing output from link-lang-check.py script"
- Solution: Check that Python dependencies are correctly installed and that script permissions are set correctly
Extending the Workflow
To enhance this workflow:
-
To add additional documentation checks:
- Add new scripts to the
scripts/directory - Add new steps to the workflow that execute these scripts
- Ensure proper error handling and output is implemented
- Add new scripts to the
-
To modify validation criteria:
- Edit the existing scripts in the
scripts/directory to change what they check for
- Edit the existing scripts in the
Related Workflows
- docs-check-terraform.yml: Similar workflow for Terraform documentation validation
Security Considerations
This workflow requires read-only access to the repository and doesn't handle any sensitive information.
🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.