Skip to content

Commit a865e4e

Browse files
test: test github-action
1 parent 8fcf0af commit a865e4e

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Release
2+
23
on:
34
push:
45
branches:
@@ -12,7 +13,7 @@ jobs:
1213
- name: Checkout repository
1314
uses: actions/checkout@v4
1415

15-
- name: Use node.js
16+
- name: Use Node.js
1617
uses: actions/setup-node@v4
1718
with:
1819
node-version: '20.x'
@@ -27,7 +28,7 @@ jobs:
2728
with:
2829
path: |
2930
**/node_modules
30-
key: ${{runner.OS}}-${{hashFiles('**/pnpm-lock.yaml')}}
31+
key: ${{ runner.OS }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3132

3233
- name: Installing Dependencies
3334
if: steps.cache-dependencies.outputs.cache-hit != 'true'
@@ -38,9 +39,26 @@ jobs:
3839

3940
- name: Running Build
4041
run: pnpm run build
41-
42-
- name: Debug - Check GITHUB_TOKEN
43-
run: echo "GITHUB_TOKEN is set: ${{ secrets.GHP_TOKEN != '' }}"
42+
43+
- name: Check if GHP_TOKEN is Set and Valid
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }}
46+
run: |
47+
if [ -z "$GITHUB_TOKEN" ]; then
48+
echo "❌ GHP_TOKEN is not set!"
49+
exit 1
50+
fi
51+
52+
echo "✅ GHP_TOKEN is set. Testing against GitHub API..."
53+
54+
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user | jq .
55+
56+
if [ $? -ne 0 ]; then
57+
echo "❌ Failed to access GitHub API with GHP_TOKEN"
58+
exit 1
59+
else
60+
echo "✅ Successfully accessed GitHub API with GHP_TOKEN"
61+
fi
4462
4563
- name: Create Release Pull Request or Publish
4664
id: changesets
@@ -52,4 +70,4 @@ jobs:
5270
title: 'Changesets: versioning & publish'
5371
env:
5472
GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }}
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)