File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 runs-on : ubuntu-latest
2626 permissions :
2727 contents : write
28+ actions : write
2829 steps :
2930 - name : Checkout current repo
3031 uses : actions/checkout@v4
3738 repository : TencentCloudBase/awsome-cloudbase-examples
3839 ref : ${{ github.event.inputs.target_branch || 'master' }}
3940 path : cloudbase-examples
41+ token : ${{ secrets.CLOUDBASE_EXAMPLES_TOKEN }}
4042
4143 - name : Setup Node.js
4244 uses : actions/setup-node@v4
8284 - name : Commit and push changes
8385 if : github.event.inputs.commit_changes == 'true'
8486 working-directory : cloudbase-examples
87+ env :
88+ PAT_TOKEN : ${{ secrets.CLOUDBASE_EXAMPLES_TOKEN }}
8589 run : |
8690 git config user.name "github-actions[bot]"
8791 git config user.email "github-actions[bot]@users.noreply.github.com"
9094 echo "No changes to commit, skipping commit and push"
9195 else
9296 git commit -m "chore: sync config from ${{ github.event.inputs.source_branch || 'main' }}"
97+ git remote set-url origin https://x-access-token:${PAT_TOKEN}@github.com/TencentCloudBase/awsome-cloudbase-examples.git
9398 git push origin ${{ github.event.inputs.target_branch || 'master' }}
9499 fi
Original file line number Diff line number Diff line change 3131 repository : TencentCloudBase/awsome-cloudbase-examples
3232 ref : ${{ github.event.inputs.target_branch }}
3333 path : cloudbase-examples
34+ token : ${{ secrets.CLOUDBASE_EXAMPLES_TOKEN }}
3435
3536 - name : Setup Node.js
3637 uses : actions/setup-node@v4
6162 - name : Commit and push changes
6263 if : github.event.inputs.commit_changes == 'true'
6364 working-directory : cloudbase-examples
65+ env :
66+ PAT_TOKEN : ${{ secrets.CLOUDBASE_EXAMPLES_TOKEN }}
6467 run : |
6568 git config user.name "github-actions[bot]"
6669 git config user.email "github-actions[bot]@users.noreply.github.com"
6972 echo "No changes to commit, skipping commit and push"
7073 else
7174 git commit -m "chore: sync config from ${{ github.event.inputs.source_branch }}"
75+ git remote set-url origin https://x-access-token:${PAT_TOKEN}@github.com/TencentCloudBase/awsome-cloudbase-examples.git
7276 git push origin ${{ github.event.inputs.target_branch }}
7377 fi
Original file line number Diff line number Diff line change @@ -331,8 +331,9 @@ const ideRulesConfigs = [
3313315 . 点击 "Run workflow" 按钮
332332
333333** 注意事项** :
334- - 由于两个仓库在同一组织下,使用默认的 ` GITHUB_TOKEN ` 即可访问
334+ - 需要配置 ` CLOUDBASE_EXAMPLES_TOKEN ` secret(Personal Access Token)用于访问 cloudbase-examples 仓库
335335- 如果目标分支不存在,workflow 会自动创建
336+ - 创建 PAT 时需要勾选 ` repo ` 权限
336337
337338## 行为准则
338339
You can’t perform that action at this time.
0 commit comments