pull_request action "edited": changes by seregamorph · Pull Request #979 · hub4j/github-api

Description

Webhook with X-GitHub-Event: pull_request and "action": "edited" has a field "changes" that is not present in GHEventPayload.PullRequest. I've found three triggers that leads to "edited" action:

  • Change PR title:
...
  "changes": {
    "title": {
      "from": "REST-276 - easy-random"
    }
  },
...

(full payload - in test data)

  • Change PR description:
...
"changes": {
    "body": {
      "from": "**JIRA Ticket URL:**\r\nhttps://jira.devfactory.com/browse/REST-276\r\n\r\n..."
    }
  },
...
  • Change target branch:
...
  "changes": {
    "base": {
      "ref": {
        "from": "develop"
      },
      "sha": {
        "from": "4b0f3b9fd582b071652ccfccd10bfc8c143cff96"
      }
    }
  },
...

So, "changes" fields contain old value that was changed, while pull_request object has latest values (see UT json payloads). Any other changes of a PR in GitHub UI leads to other types of notifications (e.g. action is assigned or ready_for_review or labeled).