2
0

backport.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Backport pull request
  2. on:
  3. pull_request_target:
  4. types: [closed]
  5. issue_comment:
  6. types: [created]
  7. permissions:
  8. contents: write # so it can comment
  9. pull-requests: write # so it can create pull requests
  10. jobs:
  11. backport:
  12. name: Backport pull request
  13. runs-on: ubuntu-24.04
  14. # Only run when pull request is merged
  15. # or when a comment starting with `/backport` is created by someone other than the
  16. # https://github.com/backport-action bot user (user id: 97796249). Note that if you use your
  17. # own PAT as `github_token`, that you should replace this id with yours.
  18. if: >
  19. (
  20. github.event_name == 'pull_request_target' &&
  21. github.event.pull_request.merged
  22. ) || (
  23. github.event_name == 'issue_comment' &&
  24. github.event.issue.pull_request &&
  25. github.event.comment.user.id != 97796249 &&
  26. startsWith(github.event.comment.body, '/backport')
  27. )
  28. steps:
  29. - uses: actions/checkout@v4
  30. - name: Create backport pull requests
  31. uses: korthout/backport-action@v3
  32. with:
  33. label_pattern: '^port/(.+)$'