Update scripts/verify-docs-commands.js #295
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Labeling • Discussions, Issues & PRs (Unified) | ||
| on: | ||
| push: | ||
| branches: [develop] | ||
| pull_request: | ||
| branches: [develop] | ||
| types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled, transferred] | ||
| issues: | ||
| types: [opened, edited, reopened, labeled, unlabeled, transferred] | ||
| discussion: | ||
| types: [created, edited, answered, reopened] | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: "Run without writing labels" | ||
| required: false | ||
| default: "true" | ||
| report_commit: | ||
| description: "Commit report to repo (requires contents: write)" | ||
| required: false | ||
| default: "false" | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
| discussions: write | ||
| concurrency: | ||
| group: labeling-${{ github.event_name }}-${{ github.event.number || github.run_id }} | ||
| cancel-in-progress: false | ||
| env: | ||
| LABELS_CONFIG: .github/automation/labels.yml | ||
| ISSUE_TYPES_CONFIG: .github/automation/issue-types.yml | ||
| LABELER_RULES: .github/automation/labeler.yml | ||
| jobs: | ||
| labeling: | ||
| name: Unified Labeling, Status, and Type Assignment | ||
| runs-on: ubuntu-latest | ||
| if: "!contains(github.event.head_commit.message, '[skip labeling]')" | ||
| steps: | ||
| - name: Sync labels with canonical set | ||
| run: | | ||
| npm install js-yaml | ||
| node .github/agents/includes/label-sync.js | ||
| shell: bash | ||
| continue-on-error: false | ||
| # Guardrail: Check for unknown labels in templates/types | ||
| - name: Guardrail — Check for unknown labels in templates/types | ||
| run: | | ||
| npm install js-yaml | ||
| node .github/agents/includes/check-template-labels.js | ||
| shell: bash | ||
| continue-on-error: false | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: develop | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Install deps | ||
| run: npm ci || true | ||
| # Apply file/branch-based labels using labeler.yml (for PRs) | ||
| - name: File/branch labeler (actions/labeler) | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/labeler@v5 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| configuration-path: ${{ env.LABELER_RULES }} | ||
| dry-run: ${{ inputs.dry_run || 'true' }} | ||
| sync-labels: true | ||
| configuration-path: ${{ env.LABELER_RULES }} | ||
| sync-labels: true | ||
| # Run unified labeling agent for issues and PRs | ||
| - name: Run labeling agent | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | ||
| configuration-path: ${{ env.LABELER_RULES }}, ${{ env.LABELS_CONFIG }}, ${{ env.ISSUE_TYPES_CONFIG }} | ||
| run: node .github/agents/labeling.agent.js | ||
| - name: Generate report | ||
| id: report | ||
| run: | | ||
| mkdir -p .github/reports/labeling | ||
| node .github/agents/includes/report-writer.js > .github/reports/labeling/${{ github.run_id }}.md | ||
| - name: Upload report artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: report | ||
| labeling-report-${{ github.run_id }} | ||
| path: .github/reports/labeling/${{ github.run_id }}.md | ||
| - name: Optionally commit report | ||
| uses: actions/github-script@v7 | ||
| if: ${{ inputs.report_commit == 'true' }} | ||
| env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add .github/reports/labeling/${{ github.run_id }}.md | ||
| git commit -m "chore(labeling): add report for run ${{ github.run_id }}" | ||
| git push origin HEAD:develop | ||
| name: Labeling | ||
| on: | ||
| issues: | ||
| types: [opened, edited, reopened] | ||
| pull_request: | ||
| types: [opened, edited, reopened, synchronize] | ||
| discussion: | ||
| types: [created, edited] | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: "Run without writing labels" | ||
| required: false | ||
| default: "true" | ||
| report_commit: | ||
| description: "Commit report to repo (requires contents: write)" | ||
| required: false | ||
| default: "false" | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| pull-requests: write | ||
| discussions: write | ||
| jobs: | ||
| label: | ||
| runs-on: ubuntu-latest | ||
| if: "!contains(github.event.head_commit.message, '[skip labeling]')" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| - name: Install deps | ||
| run: npm ci | ||
| - name: Run labeling agent | ||
| env: | ||
| DRY_RUN: ${{ inputs.dry_run || 'true' }} | ||
| run: node .github/agents/labeling.agent.js | ||
| - name: Generate report | ||
| id: report | ||
| run: | | ||
| mkdir -p .github/reports/labeling | ||
| node .github/agents/includes/report-writer.js > .github/reports/labeling/${{ github.run_id }}.md | ||
| - name: Upload report artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: labeling-report-${{ github.run_id }} | ||
| path: .github/reports/labeling/${{ github.run_id }}.md | ||
| - name: Optionally commit report | ||
| if: ${{ inputs.report_commit == 'true' }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add .github/reports/labeling/${{ github.run_id }}.md | ||
| git commit -m "chore(labeling): add report for run ${{ github.run_id }}" | ||
| git push origin HEAD:develop | ||