ci: trigger version workflow on changeset-only pushes (#1873) #260
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: version | |
| # Opens/updates the "chore: version packages" PR via changesets/action. | |
| # This workflow NEVER publishes — no `publish:` input is passed to the action, | |
| # so the action has no path to npm even if local versions drift. The actual | |
| # `latest` publish happens in `publish.yml` when this PR is merged (gated on | |
| # the head commit subject "chore: version packages"). | |
| # | |
| # `commitMode: github-api` makes the PR commit show up as Verified without | |
| # shipping signing keys to CI. | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| version-pr: | |
| runs-on: ubuntu-latest | |
| # Don't try to open a version PR on top of the version commit itself. | |
| if: "!startsWith(github.event.head_commit.message, 'chore: version packages')" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| - uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0 | |
| with: | |
| version: npm run version | |
| title: 'chore: version packages' | |
| commit: 'chore: version packages' | |
| commitMode: github-api | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |