-
Notifications
You must be signed in to change notification settings - Fork 333
36 lines (32 loc) · 1.01 KB
/
comment-on-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This PR runs separately fron the workflow that generates PR info.
# In this way, we get info from PRs from forked repositories
# without granting them extra permissions,
# but still allowing us to comment on the PRs.
name: Comment on PR
on:
workflow_run:
workflows: ["Get PR URL, dependent jobs"]
types:
- completed
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download info on PR
uses: dawidd6/action-download-artifact@v2
with:
workflow: pr-url-and-dependent.yaml
workflow_conclusion: completed
name: pr-info
- name: Get PR number
id: pr_number
run: |
PR_NUMBER=$(cat pr_number.txt)
echo "PR number is $PR_NUMBER"
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Post PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.pr_number.outputs.pr_number }}
path: pr_comment.txt