Automatic pull request labels and release comments?

I would like to have PR’s labelled with released / not-yet-released, based on, whether there exists any release, where PR is merged.

Also, when a release is created, then a comment to PR would be useful, ie.: released in version x.y.z.

So, ideally, I would expect following behavior:

  • merge of PR: label with not-yet-released,
  • release creation, for each merged, but `not-yet-released, PR:
    • label with released, remove not-yet-released,
    • add comment: released in version x.y.z,
  • deletion of release, for each merged PR, which isn’t released anymore:
    • label with not-yet-released, remove released,
    • add comment: release x.y.z deleted, PR isn’t released.

I’ll be satisfied with any partial solution though,…