{"id":31785311,"url":"https://github.com/quantecon/action-check-warnings","last_synced_at":"2025-10-10T11:52:51.742Z","repository":{"id":317463284,"uuid":"1067525647","full_name":"QuantEcon/action-check-warnings","owner":"QuantEcon","description":"GitHub Action for checking Python warnings in HTML documentation output","archived":false,"fork":false,"pushed_at":"2025-10-01T03:01:42.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-01T03:36:17.033Z","etag":null,"topics":["documentation","github-action","jupyter-book","python","quantecon","warnings"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuantEcon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"numfocus","custom":"https://numfocus.org/donate-to-quantecon"}},"created_at":"2025-10-01T01:36:16.000Z","updated_at":"2025-10-01T03:01:45.000Z","dependencies_parsed_at":"2025-10-01T03:36:21.287Z","dependency_job_id":null,"html_url":"https://github.com/QuantEcon/action-check-warnings","commit_stats":null,"previous_names":["quantecon/action-check-warnings"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/QuantEcon/action-check-warnings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2Faction-check-warnings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2Faction-check-warnings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2Faction-check-warnings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2Faction-check-warnings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantEcon","download_url":"https://codeload.github.com/QuantEcon/action-check-warnings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2Faction-check-warnings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003717,"owners_count":26083610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","github-action","jupyter-book","python","quantecon","warnings"],"created_at":"2025-10-10T11:52:48.979Z","updated_at":"2025-10-10T11:52:51.732Z","avatar_url":"https://github.com/QuantEcon.png","language":"HTML","funding_links":["https://github.com/sponsors/numfocus","https://numfocus.org/donate-to-quantecon"],"categories":[],"sub_categories":[],"readme":"# Check for Python Warnings Action\n\n[![CI](https://github.com/QuantEcon/action-check-warnings/actions/workflows/ci.yml/badge.svg)](https://github.com/QuantEcon/action-check-warnings/actions/workflows/ci.yml)\n\nA GitHub Action that scans HTML files for Python warnings within code cell outputs and optionally fails the workflow if any are found. Perfect for ensuring documentation builds are warning-free.\n\n## 🎯 Features\n\n- **Smart Detection**: Only scans warnings within code cell outputs (`cell_output` class) to avoid false positives\n- **Comprehensive Coverage**: Supports all Python warning types by default\n- **Flexible Reporting**: Create GitHub issues, workflow artifacts, or PR comments\n- **Configurable**: Customize warning types, paths, and behavior\n- **CI/CD Ready**: Seamlessly integrates with documentation build workflows\n\n## 🚀 Quick Start\n\n```yaml\n    - name: Check for warnings\n      uses: QuantEcon/action-check-warnings@v1.0.0\n      with:\n        html-path: './_build/html'\n```\n\n## Features\n\n- Scans HTML files for configurable Python warnings **within code cell outputs only**\n- Prevents false positives by only checking warnings in `cell_output` HTML elements\n- Supports multiple warning types (all Python warning types by default: UserWarning, DeprecationWarning, PendingDeprecationWarning, SyntaxWarning, RuntimeWarning, FutureWarning, ImportWarning, Uni[...]\n- Provides detailed output about warnings found\n- Optionally fails the workflow when warnings are detected\n- **Creates GitHub issues** with detailed warning reports\n- **Generates workflow artifacts** containing warning reports\n- **Posts PR comments** with warning reports when failing on warnings\n- Configurable search path and warning types\n\n## Usage\n\n### Basic Usage\n\n```yaml\n- name: Check for Python warnings\n  uses: QuantEcon/action-check-warnings@v1.0.0\n```\n\n### Advanced Usage with PR Comments\n\n```yaml\n- name: Check for Python warnings with PR feedback\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    # Uses comprehensive default warnings (all Python warning types)\n    fail-on-warning: 'true'  # This will post a comment to the PR if warnings are found\n```\n\n### Advanced Usage with Issue Creation\n\n```yaml\n- name: Check for Python warnings with issue creation\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    # Uses comprehensive default warnings (all Python warning types)\n    fail-on-warning: 'false'\n    create-issue: 'true'\n    issue-title: 'Python Warnings Found in Documentation Build'\n```\n\n### Advanced Usage with Issue Creation and User Assignment\n\n```yaml\n- name: Check for Python warnings with assigned issue\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    # Uses comprehensive default warnings (all Python warning types)\n    fail-on-warning: 'false'\n    create-issue: 'true'\n    issue-title: 'Python Warnings Found in Documentation Build'\n    notify: 'username1,username2'  # Assign issue to multiple users\n```\n\n### Advanced Usage with Artifact Creation\n\n```yaml\n- name: Check for Python warnings with artifact\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    # Uses comprehensive default warnings (all Python warning types)\n    fail-on-warning: 'true'\n    create-artifact: 'true'\n    artifact-name: 'python-warning-report'\n```\n\n### Complete Advanced Usage\n\n```yaml\n- name: Check for Python warnings in build output\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    # Uses comprehensive default warnings (all Python warning types)\n    fail-on-warning: 'false'\n    create-issue: 'true'\n    issue-title: 'Python Warnings Detected in Build'\n    notify: 'maintainer1,reviewer2'  # Assign to specific team members\n    create-artifact: 'true'\n    artifact-name: 'detailed-warning-report'\n```\n\n### Excluding Specific Warning Types\n\nSometimes you may want to temporarily exclude certain warning types (e.g., when dealing with upstream warnings that take time to fix):\n\n```yaml\n- name: Check for Python warnings excluding upstream warnings\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    exclude-warning: 'UserWarning'  # Exclude single warning type\n    fail-on-warning: 'true'\n```\n\n```yaml\n- name: Check for Python warnings excluding multiple warning types\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    exclude-warning: 'UserWarning,RuntimeWarning,ResourceWarning'  # Exclude multiple warnings\n    fail-on-warning: 'true'\n```\n\n### Custom Warning Types with Exclusions\n\nYou can combine custom warning lists with exclusions:\n\n```yaml\n- name: Check for specific warnings but exclude problematic ones\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    warnings: 'UserWarning,DeprecationWarning,RuntimeWarning,ResourceWarning'\n    exclude-warning: 'ResourceWarning'  # Check all above except ResourceWarning\n    fail-on-warning: 'true'\n```\n\n### Using Outputs\n\n```yaml\n- name: Check for Python warnings\n  id: warning-check\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    fail-on-warning: 'false'\n\n- name: Report warnings\n  if: steps.warning-check.outputs.warnings-found == 'true'\n  run: |\n    echo \"Found ${{ steps.warning-check.outputs.warning-count }} warnings:\"\n    echo \"${{ steps.warning-check.outputs.warning-details }}\"\n```\n\n## New Features\n\n### GitHub Issue Creation\n\nWhen `create-issue` is set to `true`, the action will automatically create a GitHub issue when warnings are detected. The issue includes:\n\n- Detailed warning information with file paths and line numbers\n- Repository and workflow context\n- Direct links to the failing workflow run\n- Suggested next steps for resolution\n- Automatic labeling (`bug`, `documentation`, `python-warnings`)\n\n#### Automatic User Assignment\n\nWhen the `notify` parameter is provided, the created issue will be automatically assigned to the specified GitHub users. This feature supports:\n\n- Single user assignment: `notify: 'username'`\n- Multiple user assignment: `notify: 'user1,user2,user3'`\n- Robust error handling: If assignment fails, the issue is still created successfully\n\nThis ensures that the right team members are immediately notified about warnings and can take action to resolve them.\n\nAdditionally, when issues are created in pull request contexts, a simple notification comment is posted to the PR thread containing:\n\n- List of files with warnings\n- Direct link to the created issue for detailed information\n\nThis provides immediate awareness to PR authors without cluttering the conversation with full warning details.\n\n### Workflow Artifacts\n\nWhen `create-artifact` is set to `true`, the action generates a detailed Markdown report as a workflow artifact. This report includes:\n\n- Complete warning details in a readable format\n- Repository and workflow metadata\n- Timestamp and commit information\n- Downloadable for offline review\n\n### Pull Request Comments\n\nWhen `fail-on-warning` is set to `true` and warnings are found in a pull request, the action automatically posts a detailed comment to the PR containing:\n\n- Complete warning information formatted for easy reading\n- Direct links to the failing workflow run\n- Suggested next steps for fixing the warnings\n- Repository and commit context\n\nThis feature helps developers quickly identify and fix warnings without digging through workflow logs.\n\n### Using Both Features Together\n\nYou can enable both issue creation and artifact generation simultaneously:\n\n```yaml\n- name: Comprehensive warning check\n  uses: QuantEcon/action-check-warnings@v1.0.0\n  with:\n    html-path: './_build/html'\n    fail-on-warning: 'false'  # Don't fail, just report\n    create-issue: 'true'      # Create issue for tracking\n    create-artifact: 'true'   # Create artifact for detailed review\n```\n\n## How It Works\n\nThis action specifically searches for Python warnings within HTML elements that have `cell_output` in their class attribute. This approach prevents false positives that would occur if warnings li[...]\n\n### Example HTML Structure\n\nThe action will detect warnings in this structure:\n```html\n\u003cdiv class=\"cell_output\"\u003e\n    \u003cpre\u003e\n    /path/to/file.py:10: FutureWarning: This feature will be deprecated\n      result = old_function()\n    \u003c/pre\u003e\n\u003c/div\u003e\n```\n\nBut will **ignore** warnings mentioned in regular content:\n```html\n\u003cdiv class=\"content\"\u003e\n    \u003cp\u003eIn this tutorial, we'll discuss FutureWarning messages.\u003c/p\u003e\n\u003c/div\u003e\n```\n\nThis ensures that educational content about warnings doesn't trigger false positives in the check.\n\n## Permissions\n\nFor the action to work correctly with all features, ensure your workflow has the appropriate permissions:\n\n```yaml\npermissions:\n  contents: read          # For checking out the repository\n  issues: write          # For creating GitHub issues (if create-issue is enabled)\n  actions: read          # For creating workflow artifacts (if create-artifact is enabled)\n  pull-requests: write   # For posting PR comments (when fail-on-warning is true OR create-issue is true in PRs)\n```\n\nIf you're only using the basic warning check functionality, only `contents: read` is required. Add `pull-requests: write` when you want PR comments on warnings or when using issue creation in PR [...]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantecon%2Faction-check-warnings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantecon%2Faction-check-warnings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantecon%2Faction-check-warnings/lists"}