chore: 🤖 sync copilot instructions - 2026-09-18 #12
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: review-pre-commit-pr | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| # Manually re-scan open PRs for any that meet the pre-commit.ci autoupdate criteria | |
| workflow_dispatch: | |
| inputs: | |
| force-review: | |
| description: "Force review of pre-commit.ci autoupdate PRs" | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| find-prs: | |
| # Only needed when manually dispatched; the pull_request event already has a single PR to act on | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| pr-numbers: ${{ steps.search.outputs.pr-numbers }} | |
| steps: | |
| - name: Search for open pre-commit.ci autoupdate PRs | |
| id: search | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| pr_numbers=$(gh pr list \ | |
| --repo "${{ github.repository }}" \ | |
| --state open \ | |
| --json number,title,author \ | |
| --jq '[.[] | select(.title == "[pre-commit.ci] pre-commit autoupdate" and .author.is_bot)] | map(.number)') | |
| echo "pr-numbers=${pr_numbers}" >> "$GITHUB_OUTPUT" | |
| review-pre-commit-pr: | |
| needs: [find-prs] | |
| runs-on: ubuntu-latest | |
| #container: nciccbr/ccbr_actions:latest | |
| # Only run for pre-commit.ci autoupdate PRs, whether from the pull_request event or a manual re-scan | |
| if: > | |
| always() && | |
| ( | |
| (github.event_name == 'pull_request' && github.event.pull_request.title == '[pre-commit.ci] pre-commit autoupdate' && github.event.sender.type == 'Bot') | |
| || (github.event_name == 'workflow_dispatch' && needs.find-prs.outputs.pr-numbers != '[]') | |
| ) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pr-number: ${{ github.event_name == 'workflow_dispatch' && fromJson(needs.find-prs.outputs.pr-numbers) || fromJson(format('[{0}]', github.event.pull_request.number)) }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| if: ${{ env.CCBR_ACTIONS_DOCKER != 'true' }} | |
| - name: Generate CCBR-bot token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| client-id: ${{ vars.CCBR_BOT_APP_ID }} | |
| private-key: ${{ secrets.CCBR_BOT_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| permission-contents: write | |
| permission-issues: write | |
| permission-pull-requests: write | |
| - uses: CCBR/actions/review-pre-commit-pr@pr-review-manual | |
| with: | |
| ccbr-actions-version: pr-review-manual | |
| github-token: ${{ steps.generate-token.outputs.token }} | |
| pr-number: ${{ matrix.pr-number }} | |
| repo: ${{ github.repository }} | |
| force-review: ${{ github.event.inputs.force-review || false }} |