diff --git a/.github/changeset-preview/package.json b/.github/changeset-preview/package.json index b78a9860..6bde613e 100644 --- a/.github/changeset-preview/package.json +++ b/.github/changeset-preview/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@changesets/get-release-plan": "^4.0.16" + "@changesets/get-release-plan": "^5.0.0" } } diff --git a/.github/comment-on-release/README.md b/.github/comment-on-release/README.md index 84675e00..c6b20ba3 100644 --- a/.github/comment-on-release/README.md +++ b/.github/comment-on-release/README.md @@ -42,24 +42,25 @@ Add this step to your `.github/workflows/release.yml` file after the `changesets ```yaml - name: Run Changesets (version or publish) id: changesets - uses: changesets/action@v1.5.3 + uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2 with: - version: pnpm run changeset:version - publish: pnpm run changeset:publish - commit: 'ci: Version Packages' - title: 'ci: Version Packages' - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} + github-token: ${{ secrets.GH_TOKEN }} + version-script: pnpm run changeset:version + publish-script: pnpm run changeset:publish + commit-message: 'ci: Version Packages' + pr-title: 'ci: Version Packages' - name: Comment on PRs about release if: steps.changesets.outputs.published == 'true' uses: TanStack/config/.github/comment-on-release@main with: - published-packages: ${{ steps.changesets.outputs.publishedPackages }} + published-packages: ${{ steps.changesets.outputs.published-packages }} GH_TOKEN: ${{ secrets.GH_TOKEN }} ``` -This action requires the `GH_TOKEN` input to authenticate with the GitHub API. +The release workflow in this example requires a `GH_TOKEN` secret for its custom +GitHub token. The comment action also supports the default `github.token` when its +`GH_TOKEN` input is omitted or empty. ## Requirements diff --git a/.github/comment-on-release/action.yml b/.github/comment-on-release/action.yml index e8087e21..0563c0b0 100644 --- a/.github/comment-on-release/action.yml +++ b/.github/comment-on-release/action.yml @@ -16,4 +16,4 @@ runs: run: node ${{ github.action_path }}/comment-on-release.ts env: PUBLISHED_PACKAGES: ${{ inputs.published-packages }} - GH_TOKEN: ${{ inputs.GH_TOKEN }} + GH_TOKEN: ${{ inputs.GH_TOKEN || github.token }} diff --git a/.github/comment-on-release/comment-on-release.ts b/.github/comment-on-release/comment-on-release.ts index 9bd73810..60dfe0b2 100644 --- a/.github/comment-on-release/comment-on-release.ts +++ b/.github/comment-on-release/comment-on-release.ts @@ -250,7 +250,7 @@ async function commentOnIssue( async function main() { // Read published packages from environment variable (set by GitHub Actions) const publishedPackagesJson = process.env.PUBLISHED_PACKAGES - const repository = process.env.REPOSITORY + const repository = process.env.REPOSITORY || process.env.GITHUB_REPOSITORY if (!publishedPackagesJson) { console.log('No packages were published. Skipping PR comments.') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67914bd6..d9f56c0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,7 @@ jobs: contents: write id-token: write pull-requests: write + issues: write steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -37,15 +38,14 @@ jobs: id: changesets uses: changesets/action@ae32849d5ba541f9ae29e40e22a623bc13562f51 # v2.1.2 with: + github-token: ${{ secrets.GH_TOKEN }} version-script: pnpm run changeset:version publish-script: pnpm run changeset:publish commit-message: 'ci: Version Packages' pr-title: 'ci: Version Packages' - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - name: Comment on PRs and issues about release if: steps.changesets.outputs.published == 'true' uses: ./.github/comment-on-release with: - published-packages: ${{ steps.changesets.outputs.publishedPackages }} + published-packages: ${{ steps.changesets.outputs.published-packages }} GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9e51413..e9e85301 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ If you have been assigned to fix an issue or develop a new feature, please follo pnpm install ``` - - We use [pnpm](https://pnpm.io/) v9 for package management (run in case of pnpm-related issues). + - We use [pnpm](https://pnpm.io/) v12 for package management (run in case of pnpm-related issues). ```bash corepack enable && corepack prepare