Repository navigation
feat: only use cache for row lookups if cache is available #8688
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: PR Triage | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: | |
| PR number to classify (leave blank to classify all open PRs) | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| concurrency: | |
| group: | |
| ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id | |
| }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test triage logic | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - run: node --test .github/scripts/__tests__/pr-triage-classify.test.js | |
| classify: | |
| name: Classify PR risk tier | |
| needs: test | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 8 | |
| # For pull_request events skip drafts; workflow_dispatch always runs | |
| if: | |
| ${{ github.event_name == 'workflow_dispatch' || | |
| !github.event.pull_request.draft }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Classify and label PR(s) | |
| uses: actions/github-script@v9 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const path = require('path'); | |
| const run = require(path.join(process.env.GITHUB_WORKSPACE, '.github/scripts/pr-triage.js')); | |
| await run({ github, context }); |