fix: handle missing module release tags (#112) #129
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-release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: changeset-release | |
| cancel-in-progress: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| registry-url: https://registry.npmjs.org | |
| - run: pnpm install --frozen-lockfile | |
| - name: Build all workspaces | |
| run: pnpm -r --filter '!@sfmc-bds/docs-site' run build | |
| - name: build publishable workspaces | |
| run: node packages/tools/build-publishable.mjs | |
| # Version PR 需要「创建 PR」权限。仅用 GITHUB_TOKEN 且仓库关闭 | |
| # Settings→Actions→General→「Allow GitHub Actions to create and approve pull requests」时, | |
| # changesets/action 会 HttpError(分支已推送但 PR 未创建)。 | |
| - name: Create Release Pull Request or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm run version-packages | |
| # tag-packages 默认 HEAD~1 版本 diff(空状态文件亦信任) | |
| publish: pnpm run ci-release-packages | |
| title: "chore(release): version packages" | |
| commit: "chore(release): version packages" | |
| createGithubReleases: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.SFMC_GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |