@@ -14,22 +14,27 @@ jobs:
14
14
15
15
- name : Retrieve pull request information
16
16
id : pr-info
17
- uses : gr2m/get-json-paths-action@v1
18
- with :
19
- url : ${{ github.event.pull_request.url }}
20
- jsonPath : |
21
- .title
22
- .body
23
- .labels[*].name
24
- .user.login
17
+ run : |
18
+ PR_NUMBER=$(echo "${{ github.event.pull_request.url }}" | awk -F'/' '{print $NF}')
19
+ PR_JSON=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER")
20
+ TITLE=$(echo "$PR_JSON" | jq -r .title)
21
+ BODY=$(echo "$PR_JSON" | jq -r .body)
22
+ USER=$(echo "$PR_JSON" | jq -r .user.login)
23
+ LABELS=$(echo "$PR_JSON" | jq -r '.labels | map(.name) | join(", ")')
24
+ echo "::set-output name=title::$TITLE"
25
+ echo "::set-output name=body::$BODY"
26
+ echo "::set-output name=user::$USER"
27
+ echo "::set-output name=labels::$LABELS"
25
28
26
29
# Additional steps to extract, format, and append release notes
27
30
# (e.g., using scripts or other actions)
28
31
29
32
- name : Commit release notes
30
33
run : |
31
- git config --local user.email "amitjoshiengineersmind@gmail.com"
32
- git config --local user.name "amitpjoshiem"
33
- git add RELEASE_NOTES.md
34
- git commit -m "Add release notes for PR #${{ github.event.pull_request.number }}"
35
- git push
34
+ echo "Release notes for PR ${{ github.event.pull_request.number }}:"
35
+ echo "Title: ${{ steps.pr-info.outputs.title }}"
36
+ echo "Body: ${{ steps.pr-info.outputs.body }}"
37
+ echo "User: ${{ steps.pr-info.outputs.user }}"
38
+ echo "Labels: ${{ steps.pr-info.outputs.labels }}"
39
+
40
+ # Add your logic to append the release notes to a file and commit changes
0 commit comments