File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Display PR Details
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened]
6
+
7
+ jobs :
8
+ display-pr-details :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Checkout code
13
+ uses : actions/checkout@v2
14
+
15
+ - name : Fetch PR details
16
+ id : pr-details
17
+ run : |
18
+ PR_NUMBER=${{ github.event.pull_request.number }}
19
+ PR_TITLE=${{ github.event.pull_request.title }}
20
+ PR_BODY=${{ github.event.pull_request.body }}
21
+ PR_USER=${{ github.event.pull_request.user.login }}
22
+ echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV
23
+ echo "PR_TITLE=${PR_TITLE}" >> $GITHUB_ENV
24
+ echo "PR_BODY=${PR_BODY}" >> $GITHUB_ENV
25
+ echo "PR_USER=${PR_USER}" >> $GITHUB_ENV
26
+
27
+ - name : Fetch PR labels
28
+ id : pr-labels
29
+ run : |
30
+ PR_NUMBER=${{ env.PR_NUMBER }}
31
+ LABELS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
32
+ "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}" \
33
+ | jq '.labels | map(.name) | join(", ")')
34
+ echo "LABELS=${LABELS}" >> $GITHUB_ENV
35
+
36
+ - name : Display PR details
37
+ run : |
38
+ echo "Pull Request Number: ${{ env.PR_NUMBER }}"
39
+ echo "Pull Request Title: ${{ env.PR_TITLE }}"
40
+ echo "Pull Request Body: ${{ env.PR_BODY }}"
41
+ echo "Pull Request User: ${{ env.PR_USER }}"
42
+ echo "Pull Request Labels: ${{ env.LABELS }}"
You can’t perform that action at this time.
0 commit comments