Skip to content

Commit 4dd32b8

Browse files
committed
ci: 将 token 从 inputs 改为 secrets
1 parent 4780b28 commit 4dd32b8

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/reusable-pr-preview.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ name: reusable-pr-preview
22

33
on:
44
workflow_call:
5-
inputs:
6-
surge-token:
5+
secrets:
6+
TDESIGN_SURGE_TOKEN:
77
required: true
8-
type: string
98

109
jobs:
1110
preview-success:
@@ -38,7 +37,7 @@ jobs:
3837
repository=${{github.repository}}
3938
project_name=${repository#*/}
4039
export DEPLOY_DOMAIN=https://preview-pr-${{ steps.pr.outputs.id }}-$project_name.surge.sh
41-
npx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ inputs.surge-token }}
40+
npx surge --project ./_site --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
4241
echo the preview URL is $DEPLOY_DOMAIN
4342
echo "url=$DEPLOY_DOMAIN" >> $GITHUB_OUTPUT
4443
- name: update status comment

.github/workflows/reusable-publish-npm.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ name: reusable-publish-npm
22

33
on:
44
workflow_call:
5+
secrets:
6+
PERSONAL_TOKEN:
7+
required: false
8+
9+
TDESIGN_SURGE_TOKEN:
10+
required: true
11+
512
inputs:
613
node-version:
714
required: false
@@ -113,7 +120,7 @@ jobs:
113120
with:
114121
project: _site
115122
domain: ${{ steps.domain.outputs.domain }}
116-
token: ${{ inputs.surge-token }}
123+
token: ${{ secrets.TDESIGN_SURGE_TOKEN }}
117124

118125
publish-official-website:
119126
runs-on: ubuntu-latest
@@ -123,7 +130,7 @@ jobs:
123130
with:
124131
ref: main
125132
fetch-depth: 0
126-
token: ${{ inputs.token }}
133+
token: ${{ secrets.PERSONAL_TOKEN }}
127134
submodules: recursive
128135

129136
- name: update official website

0 commit comments

Comments
 (0)