Feature request: Approval event

In our team we would appreciate a lot if we could get a hook into the approvals so other actions can be then hooked into JIRA for example.

Description: Add an event for Pull Requests approvals

Hi @umbert-cobiro ,

Currently, there is a  pull_request_review event, when a reviewer submit an approval, a pull_request_review event with  submitted type will occured and you could use ${{github.event.review.state }} to get the approved state. 

Here is my example for a workflow on  pull_request_review event: 

name: Test
on:
  pull_request_review:
    types: [submitted, edited, dismissed]

jobs:
  job1:
    runs-on: ubuntu-latest
    steps:
    - name: Dump GitHub context
      env:
        GITHUB_CONTEXT: ${{ toJson(github) }}
      run: echo ${{github.event.review.state }}
1 Like

Thanks, that’s great. Is that documented anywhere?

There is the document for pull_request_review event :

https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-review-event-pull_request_review

And the event Webhook payload example is showed here.

2 Likes

Super weird
It was working a few weeks ago for me but not it’s not :frowning:
github.event.review.state stores “approved” only once just after the approval and stays empty afterwards