From 6db8f4e939c9c998b367ad034ae9230e6b1caff2 Mon Sep 17 00:00:00 2001 From: wenyutang Date: Tue, 21 Jan 2025 13:46:46 +0800 Subject: [PATCH] ci: github token replace CD pat to retire the cd pat --- .github/workflows/cd.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2d81704b13..56822a1455 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -23,8 +23,8 @@ on: - cron: "0 16 * * *" permissions: - actions: read - contents: read + actions: write + contents: write jobs: cd: @@ -61,7 +61,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - token: ${{ secrets.CD_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.ref }} - uses: actions/setup-node@v3 @@ -126,13 +126,13 @@ jobs: with: tag_name: "templates@0.0.0-rc" env: - GITHUB_TOKEN: ${{ secrets.CD_PAT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: release templates' RC version to github if: ${{ (contains(steps.version-change.outputs.CHANGED, 'templates@') || contains(steps.version-change.outputs.CHANGED, '@microsoft/teamsfx')) && github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'rc' }} uses: ncipollo/release-action@v1.10.0 with: - token: ${{ secrets.CD_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} prerelease: true tag: "templates@0.0.0-rc" artifacts: ${{ github.workspace }}/templates/build/*.zip @@ -145,7 +145,7 @@ jobs: with: artifacts: ${{ github.workspace }}/templates/build/*.zip name: "Release for ${{ steps.version-change.outputs.TEMPLATE_VERSION }}" - token: ${{ secrets.CD_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.version-change.outputs.TEMPLATE_VERSION }} allowUpdates: true @@ -160,7 +160,7 @@ jobs: artifacts: ${{ runner.temp }}/template-tags.txt name: "Template Tag List" body: "Release to maintain template tag list." - token: ${{ secrets.CD_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} tag: "template-tag-list" allowUpdates: true @@ -287,7 +287,7 @@ jobs: if: ${{ contains(steps.version-change.outputs.CHANGED, 'ms-teams-vscode-extension@') && github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'stable' }} uses: ncipollo/release-action@v1.10.0 with: - token: ${{ secrets.CD_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.version-change.outputs.EXTENSION_VERSION }} artifacts: ./packages/**/*.vsix artifactErrorsFailBuild: true