Skip to content

Commit feff74a

Browse files
plusiceplusicechen
andauthored
ci: 发送具体的的 pr 链接 (#29)
Co-authored-by: plusicechen <plusicechen@tencent.com>
1 parent aab1064 commit feff74a

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

.github/workflows/after-receive-pr.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,25 @@ jobs:
1414
github.event.workflow_run.event == 'pull_request' &&
1515
github.event.workflow_run.conclusion == 'success'
1616
steps:
17+
- name: Download workflow artifact
18+
uses: dawidd6/action-download-artifact@v2.11.0
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
workflow: receive-pr.yml
22+
run_id: ${{ github.event.workflow_run.id }}
23+
- name: Read the pr_num file
24+
id: pr_num_reader
25+
uses: juliangruber/read-file-action@v1.0.0
26+
with:
27+
path: ./pr_num/pr_num.txt
28+
- name: Set pr link
29+
id: pr_link_generator
30+
run: echo "LINK=https://github.com/${{ github.repository }}/pulls/${{ steps.pr_num_reader.outputs.content }}" >> $GITHUB_OUTPUT
31+
1732
- name: notify
1833
uses: docker://tencentcom/wecom-message:latest
1934
env:
2035
PLUGIN_ROBOT: ${{ secrets.WEWORK_BOT }}
2136
PLUGIN_CONTENT: |
22-
[https://github.com/${{ github.repository }}/pulls](https://github.com/${{ github.repository }}/pulls)
23-
24-
25-
走查代码啦~ for <@${{ github.actor }}>
37+
[${{ steps.pr_link_generator.outputs.LINK }}](${{ steps.pr_link_generator.outputs.LINK }})
38+
走查代码啦~ for ${{ github.actor }}

.github/workflows/receive-pr.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ jobs:
1616
- name: markdown-lint
1717
uses: docker://tencentcom/markdown-lint:latest
1818

19+
- name: Save the PR number in an artifact
20+
shell: bash
21+
env:
22+
PR_NUM: ${{ github.event.number }}
23+
run: echo $PR_NUM > pr_num.txt
24+
- name: Upload the PR number
25+
uses: actions/upload-artifact@v2
26+
with:
27+
name: pr_num
28+
path: ./pr_num.txt

0 commit comments

Comments
 (0)