Skip to content

Commit 245b4b6

Browse files
committed
fix(actions): pass GH_TOKEN as input to composite actions
1 parent 0e7bdec commit 245b4b6

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.github/changeset-preview/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Changeset Preview
22
description: Generates comment on a PR showing expected version impact
3+
inputs:
4+
GH_TOKEN:
5+
description: GitHub token used to post the preview comment
6+
required: true
37
runs:
48
using: composite
59
steps:
@@ -18,4 +22,4 @@ runs:
1822
--body-file /tmp/changeset-preview.md \
1923
--marker "<!-- changeset-version-preview -->"
2024
env:
21-
GH_TOKEN: ${{ env.GH_TOKEN }}
25+
GH_TOKEN: ${{ inputs.GH_TOKEN }}

.github/comment-on-release/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ Add this step to your `.github/workflows/release.yml` file after the `changesets
5656
uses: TanStack/config/.github/comment-on-release@main
5757
with:
5858
published-packages: ${{ steps.changesets.outputs.publishedPackages }}
59-
env:
6059
GH_TOKEN: ${{ secrets.GH_TOKEN }}
6160
```
6261
63-
This action reads the token from the `GH_TOKEN` environment variable.
62+
This action requires the `GH_TOKEN` input to authenticate with the GitHub API.
6463

6564
## Requirements
6665

.github/comment-on-release/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
published-packages:
55
description: 'JSON string of published packages from changesets/action'
66
required: true
7+
GH_TOKEN:
8+
description: GitHub token used to comment on PRs and issues
9+
required: true
710
runs:
811
using: composite
912
steps:
@@ -12,4 +15,4 @@ runs:
1215
run: node ${{ github.action_path }}/comment-on-release.ts
1316
env:
1417
PUBLISHED_PACKAGES: ${{ inputs.published-packages }}
15-
GH_TOKEN: ${{ env.GH_TOKEN }}
18+
GH_TOKEN: ${{ inputs.GH_TOKEN }}

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ jobs:
6363
uses: ./.github/setup
6464
- name: Changeset Preview
6565
uses: ./.github/changeset-preview
66-
env:
66+
with:
6767
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ jobs:
4545
uses: ./.github/comment-on-release
4646
with:
4747
published-packages: ${{ steps.changesets.outputs.publishedPackages }}
48-
env:
4948
GH_TOKEN: ${{ secrets.GH_TOKEN }}

0 commit comments

Comments
 (0)