From 90710c1e14994c6b13f852685d8d67ea60150486 Mon Sep 17 00:00:00 2001 From: Write Int <151211283+WriteNaN@users.noreply.github.com> Date: Wed, 3 Apr 2024 18:42:38 +0530 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c24f3a2..13b0a53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,18 +15,22 @@ jobs: - name: Get Pull Request Body id: pr_body - run: | - BODY=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -H "Accept: application/vnd.github.v3+json" \ - ${{ github.api_url }}/repos/${{ github.repository }}/pulls/${{ github.event.number }} \ - | jq -r '.body') - echo "Pull Request Body: $BODY" # Debug - echo "BODY=$BODY" >> $GITHUB_ENV + uses: octokit/request-action@v2.x + with: + route: GET /repos/:owner/:repo/pulls/:pull_number + owner: ${{ github.repository_owner }} + repo: ${{ github.repository }} + pull_number: ${{ github.event.number }} + headers: | + Authorization: token ${{ secrets.GITHUB_TOKEN }} + + - name: Save Pull Request Body + run: echo "${{ steps.pr_body.outputs.data.body }}" > pr_body.txt - name: Extract Version and Changes id: extract_version_and_changes run: | - VERSION_CHANGES=$(bash ./scripts/version.sh "${{ steps.pr_body.outputs.BODY }}") + VERSION_CHANGES=$(bash ./scripts/version.sh "$(cat pr_body.txt)") echo "Extracted Version and Changes: $VERSION_CHANGES" # Debug message echo "VERSION_CHANGES=$VERSION_CHANGES" >> $GITHUB_ENV