Skip to content

Commit ff8eaad

Browse files
authored
Merge pull request #98 from opentiny/fix/remove-risk-env-vars
fix(ci): remove workflow-level env block exposing secrets
2 parents a6ea9d2 + 3799fc4 commit ff8eaad

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

.github/workflows/deploy-obs.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ on:
1717
required: false
1818
type: string
1919

20-
env:
21-
# 在 GitHub 项目源码仓库 → 项目的 Settings → Secrets(Actions 里的 Repository secrets) 里提前建好以下变量
22-
HUAWEI_CLOUD_AK: ${{ secrets.HUAWEI_CLOUD_AK }}
23-
HUAWEI_CLOUD_SK: ${{ secrets.HUAWEI_CLOUD_SK }}
24-
HUAWEI_CLOUD_ENDPOINT: ${{ secrets.HUAWEI_CLOUD_ENDPOINT }}
25-
HUAWEI_CLOUD_BUCKET: ${{ secrets.HUAWEI_CLOUD_BUCKET }}
26-
2720
permissions:
2821
contents: read
2922
pages: write
@@ -111,11 +104,11 @@ jobs:
111104
- name: Upload to OBS
112105
run: |
113106
# 一次性配置 AK/SK/endpoint
114-
obsutil config -i=${{ env.HUAWEI_CLOUD_AK }} \
115-
-k=${{ env.HUAWEI_CLOUD_SK }} \
116-
-e=${{ env.HUAWEI_CLOUD_ENDPOINT }}
107+
obsutil config -i=${{ secrets.HUAWEI_CLOUD_AK }} \
108+
-k=${{ secrets.HUAWEI_CLOUD_SK }} \
109+
-e=${{ secrets.HUAWEI_CLOUD_ENDPOINT }}
117110
118111
# 把本地 dist/ 目录整站同步到桶根目录
119112
echo "needs.build.outputs.version: ${{ needs.build.outputs.version }}"
120113
mv dist ${{ needs.build.outputs.version }}
121-
obsutil cp ${{ needs.build.outputs.version }} obs://${{ env.HUAWEI_CLOUD_BUCKET }}/opentiny-docs/ -r -f
114+
obsutil cp ${{ needs.build.outputs.version }} obs://${{ secrets.HUAWEI_CLOUD_BUCKET }}/opentiny-docs/ -r -f

0 commit comments

Comments
 (0)