Skip to content

Commit

Permalink
build: fix extraction of reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Sep 14, 2024
1 parent af35f4f commit 23702bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate_pr_commit_message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: 'Post commit message as PR comment'
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
### PR Commit Message
Expand All @@ -82,4 +82,4 @@ jobs:
${{ steps.commit_message.outputs.commit_message }}
```
*Please review the above commit message and make any necessary adjustments before merging.*
*Please review the above commit message and make any necessary adjustments.*
5 changes: 3 additions & 2 deletions .github/workflows/scripts/generate_pr_commit_message
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ main() {
pr_body=$(echo "$pr_details" | jq -r '.body // ""')
pr_url=$(echo "$pr_details" | jq -r '.html_url')

# Extract requested reviewers:
reviewers=$(echo "$pr_details" | jq -r '.requested_reviewers[].login')
# Extract reviewers:
pr_reviews=$(github_api "GET" "/repos/$REPO_OWNER/$REPO_NAME/pulls/$pr_number/reviews")
reviewers=$(echo "$pr_reviews" | jq -r '.[] | select(.state == "APPROVED" ) | .user.login' | sort -u)

# Fetch commits in the PR:
pr_commits=$(github_api "GET" "/repos/$REPO_OWNER/$REPO_NAME/pulls/$pr_number/commits")
Expand Down

0 comments on commit 23702bf

Please sign in to comment.