From 183bde55ca705120707b501b8dd21e3aa7ed0e33 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Tue, 7 May 2024 13:43:29 -0400 Subject: [PATCH] correctly fetch merged by user login --- .../update-be-new-migration-latest-timestamp.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-be-new-migration-latest-timestamp.yml b/.github/workflows/update-be-new-migration-latest-timestamp.yml index d193c8722..684c78654 100644 --- a/.github/workflows/update-be-new-migration-latest-timestamp.yml +++ b/.github/workflows/update-be-new-migration-latest-timestamp.yml @@ -38,13 +38,15 @@ jobs: rm added_files.txt git commit -m "chore: renamed new migration files to latest timestamp (gh-action)" - - name: Get the username of the person who closed the PR - run: | + - name: Get PR details + id: pr_details + run: | PR_NUMBER=${{ github.event.pull_request.number }} - PR_CLOSER=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | jq -r '.closed_by.login') + PR_MERGER=$(curl -s "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" | jq -r '.merged_by.login') + echo "PR Number: $PR_NUMBER" - echo "PR Closer: $PR_CLOSER" - echo "pr_closer=$PR_CLOSER" >> $GITHUB_OUTPUT + echo "PR Merger: $PR_MERGER" + echo "pr_merger=$PR_MERGER" >> $GITHUB_OUTPUT - name: Create Pull Request if: env.SKIP_RENAME != 'true' @@ -54,3 +56,4 @@ jobs: commit-message: 'chore: renamed new migration files to latest UTC (gh-action)' title: 'GH Action: rename new migration file timestamp' branch-suffix: timestamp + reviewers: ${{ steps.pr_details.outputs.pr_merger }}