diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 00736ab..09b6de3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -37,7 +37,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const comment = `@${context.payload.comment.user.login} TPClash 自动构建已开始, 请访问 CI 链接等待构建完成并下载: [Workflow](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`; + const comment = `@${context.payload.comment.user.login} GitHub Action has been re-run! Here is the link to the current workflow: [Workflow](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`; github.rest.issues.createComment({ issue_number: context.issue.number, @@ -80,12 +80,21 @@ jobs: run: | export TZ='Asia/Shanghai' echo "date=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_OUTPUT - - name: Package Artifact - shell: bash - run: tar -zcvf tpclash-${{ steps.timestamp.outputs.date }}.tar.gz build - name: Upload Artifact uses: actions/upload-artifact@v3 with: retention-days: 7 name: TPClash-Build-${{ steps.timestamp.outputs.date }} - path: tpclash-${{ steps.timestamp.outputs.date }}.tar.gz + path: build + - name: Create Comment Reply + uses: actions/github-script@v6 + with: + script: | + const artifactUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}/suites/${process.env.GITHUB_RUN_ID}/artifacts/${process.env.GITHUB_JOB}/zip`; + const commentBody = `@${context.payload.comment.user.login} GitHub Action has run successfully! Here is the file: [Download File](${artifactUrl})`; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: commentBody + });