feat: add configurable step limits for Workflows #3050
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: Changeset Review | |
| on: | |
| pull_request: | |
| paths: | |
| - ".changeset/*.md" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| id-token: write | |
| jobs: | |
| review-changesets: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - name: Checkout changesets | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| sparse-checkout: | | |
| .changeset | |
| .github/opencode.json | |
| - name: Install OpenCode | |
| run: | | |
| npm install -g opencode-ai | |
| cp .github/opencode.json ./opencode.json | |
| - name: Get changed changeset files | |
| id: changed-changesets | |
| uses: tj-actions/changed-files@v45 | |
| with: | |
| files: | | |
| .changeset/*.md | |
| files_ignore: | | |
| .changeset/README.md | |
| # Recover deleted files so Claude can read them (needed for Version Packages PRs) | |
| recover_deleted_files: ${{ github.event.pull_request.title == 'Version Packages' }} | |
| - name: Review Changesets with OpenCode | |
| id: opencode-review | |
| # Run for Version Packages PRs (which delete changesets) or regular PRs with new changesets | |
| if: github.event.pull_request.title == 'Version Packages' || steps.changed-changesets.outputs.added_files_count > 0 | |
| env: | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_AI_GATEWAY_ACCOUNT_ID }} | |
| CLOUDFLARE_GATEWAY_ID: ${{ secrets.CF_AI_GATEWAY_NAME }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CF_AI_GATEWAY_TOKEN }} | |
| DELETED_FILES: ${{ steps.changed-changesets.outputs.deleted_files }} | |
| ADDED_FILES: ${{ steps.changed-changesets.outputs.added_files }} | |
| run: | | |
| opencode run --print-logs \ | |
| "Review the changeset files in this PR. | |
| For \"Version Packages\" PRs, review: ${DELETED_FILES} | |
| For regular PRs, review: ${ADDED_FILES} | |
| Read \`.changeset/README.md\` for guidelines, then validate: | |
| 1. **Version Type**: Accept the author's choice of patch/minor unless clearly incorrect | |
| 2. **Changelog Quality**: Meaningful descriptions (examples encouraged but not required for features) | |
| 3. **Markdown Headers**: No h1/h2/h3 headers (breaks changelog formatting) | |
| 4. **Analytics**: If the change collects more analytics, it should be a minor even though there is no user-visible change | |
| 5. **Dependabot**: Do not validate dependency update changesets for create-cloudflare | |
| 6. **Experimental features**: Changesets for experimental features should include note on how users can opt in. | |
| If all changesets pass, just output \"✅ All changesets look good\" - no need for a detailed checklist. | |
| Do not review other files, only the changesets. This is specifically a changeset review action. | |
| If there are issues, output \"⚠️ Issues found\" followed by the specific problems. | |
| Write your review to changeset-review.md." | |
| - name: Post review comment | |
| if: steps.opencode-review.outcome == 'success' | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| header: changeset-review | |
| path: changeset-review.md | |
| - name: Skip notice | |
| if: github.event.pull_request.title != 'Version Packages' && steps.changed-changesets.outputs.added_files_count == 0 | |
| run: | | |
| echo "No new changesets to review (only minor edits to pre-existing changesets detected)" |