feat: Slack file attachments, file context in AI, probe v0.6.0-rc240 #582
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: Forbid dist changes in PRs | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, edited] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| guard-dist: | |
| # Only enforce for PRs into main; allow maintenance PRs into nightly/v1 | |
| if: github.event_name != 'pull_request' || github.event.pull_request.base.ref == 'main' | |
| name: Block dist/ commits | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Ensure no dist/ changes in this PR | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request | |
| if (!pr) { | |
| core.info('Not a pull_request event; skipping') | |
| return | |
| } | |
| const {owner, repo} = context.repo | |
| const files = await github.paginate(github.rest.pulls.listFiles, { | |
| owner, | |
| repo, | |
| pull_number: pr.number, | |
| per_page: 100, | |
| }) | |
| // Block any file under dist/, except explicitly allowed generated schema files. | |
| const blocked = files | |
| .map(f => f.filename) | |
| .filter(name => name.startsWith('dist/')) | |
| .filter(name => !name.startsWith('dist/generated/') && name !== 'dist/generated/config-schema.json') | |
| if (blocked.length) { | |
| core.setFailed( | |
| 'Changes to dist/ are not allowed in pull requests.\n' + | |
| 'Please drop these files from the PR and let CI build them during releases.\n\n' + | |
| blocked.map(f => ` - ${f}`).join('\n') | |
| ) | |
| } else { | |
| core.info('✅ No illegal dist/ changes detected') | |
| } |