Skip to content

Commit 8f17409

Browse files
authored
Merge pull request #11 from amitpjoshiem/Task-1
new workflow file
2 parents 5315815 + 34017f7 commit 8f17409

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,27 @@ jobs:
1414

1515
- name: Retrieve pull request information
1616
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"
2528
2629
# Additional steps to extract, format, and append release notes
2730
# (e.g., using scripts or other actions)
2831

2932
- name: Commit release notes
3033
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

Comments
 (0)