Skip to content

Commit

Permalink
chore(action): update action
Browse files Browse the repository at this point in the history
update action

Signed-off-by: kovacs <[email protected]>
  • Loading branch information
mritd committed Nov 1, 2023
1 parent 0811946 commit 32d2283
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
});

0 comments on commit 32d2283

Please sign in to comment.