Skip to content

How to get count of approved pull request using github actions #25374

Answered by BrightRan
so-amuk asked this question in Actions
Discussion options

You must be logged in to vote

@so-amuk,
Workaround 1: (update)

- name: get the count of requested reviewers
  run: |
    length=$(echo $requested_reviewers | jq '. | length')
    echo "length = $length"
  env:
    requested_reviewers: ${{ toJson(github.event.pull_request.requested_reviewers) }}

Can you please tell me how do you store count number in cache and use it?

You can simply write the total count of the reviewers into a text file, then save this text file as a cache with a specified key (for example, key: PR-<PR_number>-total-reviewers). In the subsequent workflow runs, you can restore this cache to the workspace and read the total count of the reviewers from the text file.
However, if some reviewers are add…

Replies: 8 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@manoj27730
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants