diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c2efacca..77e54244b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,12 +20,13 @@ jobs: - name: Build artifacts run: ./scripts/ci/build-artifacts.sh env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Comment on github run: node ./scripts/azure/github-comment.js "[Preview Preparing...](https://github.com/ng-alain/delon/actions/runs/${{ github.run_id }})" env: ACCESS_REPO: ${{ secrets.ACCESS_REPO }} - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} - name: Build site run: yarn run site:build - name: 'Deploy Site' @@ -36,7 +37,7 @@ jobs: npx surge --project ./src/dist/browser --domain $DEPLOY_DOMAIN env: ACCESS_REPO: $(ACCESS_REPO) - ACCESS_TOKEN: $(ACCESS_TOKEN) + ACCESS_TOKEN: $(GITHUB_TOKEN) SURGE_LOGIN: $(SURGE_LOGIN) SURGE_TOKEN: $(SURGE_TOKEN) - name: 'Update comment on github' @@ -45,13 +46,15 @@ jobs: node ./scripts/azure/github-comment.js "[Preview is ready!]($DEPLOY_DOMAIN)" env: ACCESS_REPO: $(ACCESS_REPO) - ACCESS_TOKEN: $(ACCESS_TOKEN) + ACCESS_TOKEN: $(GITHUB_TOKEN) + SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} - name: 'When failed' if: failure() run: node ./scripts/azure/github-comment.js "[Preview Build Failed!](https://github.com/ng-alain/delon/actions/runs/${{ github.run_id }})" env: ACCESS_REPO: $(ACCESS_REPO) - ACCESS_TOKEN: $(ACCESS_TOKEN) + ACCESS_TOKEN: $(GITHUB_TOKEN) + SYSTEM_PULLREQUEST_PULLREQUESTNUMBER: ${{ github.event.number }} test: runs-on: ubuntu-latest diff --git a/scripts/ci/build-artifacts.sh b/scripts/ci/build-artifacts.sh index fa277af43..5ecca92af 100755 --- a/scripts/ci/build-artifacts.sh +++ b/scripts/ci/build-artifacts.sh @@ -23,7 +23,7 @@ echo "Current commit author name: ${commitAuthorName}" # exit 0 # fi -echo "ACCESS_TOKEN: ${ACCESS_TOKEN}.." +# echo "ACCESS_TOKEN: ${ACCESS_TOKEN}.." if [ -z ${ACCESS_TOKEN} ]; then echo "Error: No access token for GitHub could be found." \