diff --git a/.github/workflows/preview-deploy.yml b/.github/workflows/preview-deploy.yml
index 729aeb131a..c2b6b37a57 100644
--- a/.github/workflows/preview-deploy.yml
+++ b/.github/workflows/preview-deploy.yml
@@ -42,20 +42,25 @@ jobs:
- name: Deploy has succeeded
if: ${{ success() }}
- run: |
- export DEPLOY_DOMAIN=https://preview-${PULL_REQUEST_NUMBER}-element-plus.surge.sh
- curl -X POST ${BOT_URL} -H 'Content-Type:application/json' --data-raw '{"botAction":"Preview", "pr":'${PULL_REQUEST_NUMBER}', "url":"'${DEPLOY_DOMAIN}'"}'
- env:
- BOT_URL: ${{ secrets.BOT_URL }}
- PULL_REQUEST_NUMBER: ${{ steps.pr.outputs.id }}
+ uses: actions-cool/maintain-one-comment@v1.1.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ body: |
+ [
](https://preview-${{ steps.pr.outputs.id }}-element-plus.surge.sh)
+
+ body-include: ''
+ number: ${{ steps.pr.outputs.id }}
- name: Deploy has failed
if: ${{ failure() }}
- run: |
- curl -X POST ${BOT_URL} -H 'Content-Type:application/json' --data-raw '{"status":"error", "botAction":"Preview", "pr":'${PULL_REQUEST_NUMBER}'}'
- env:
- BOT_URL: ${{ secrets.BOT_URL }}
- PULL_REQUEST_NUMBER: ${{ steps.pr.outputs.id }}
+ uses: actions-cool/maintain-one-comment@v1.1.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ body: |
+ [
](https://preview-${{ steps.pr.outputs.id }}-element-plus.surge.sh)
+
+ body-include: ''
+ number: ${{ steps.pr.outputs.id }}
# Build failed, update comment
on-failure:
@@ -74,9 +79,12 @@ jobs:
id: pr
run: echo "::set-output name=id::$(](https://preview-${{ steps.pr.outputs.id }}-element-plus.surge.sh)
+
+ body-include: ''
+ number: ${{ steps.pr.outputs.id }}
diff --git a/.github/workflows/preview-start.yml b/.github/workflows/preview-start.yml
new file mode 100644
index 0000000000..1a21203968
--- /dev/null
+++ b/.github/workflows/preview-start.yml
@@ -0,0 +1,16 @@
+name: Preview Start
+
+on: pull_request_target
+
+jobs:
+ preview:
+ runs-on: ubuntu-latest
+ steps:
+ - name: create
+ uses: actions-cool/maintain-one-comment@v1.1.0
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ body: |
+
+
+ body-include: ''