Merge pull request #10522 from dgarske/retrigger_prb_on_ready

GH Actions: retrigger Jenkins PRB when draft PR is marked ready
This commit is contained in:
Sean Parkinson
2026-05-25 20:55:05 +10:00
committed by GitHub
@@ -0,0 +1,35 @@
name: Retrigger PRB on ready for review
# When a draft PR is marked ready_for_review, GitHub fires a
# 'ready_for_review' pull_request event but no 'synchronize' event, so
# the Jenkins GHPRB plugin does not re-trigger the PRB-master-job. Post
# the configured GHPRB trigger phrase as a PR comment to kick it off.
#
# pull_request_target (not pull_request) is required so GITHUB_TOKEN
# gets write permissions on PRs from forks - this workflow only posts
# a fixed comment string, so the usual pull_request_target risk
# (executing untrusted PR code with elevated privileges) does not apply.
on:
pull_request_target:
types: [ready_for_review]
branches: [master, main]
permissions:
pull-requests: write
jobs:
retrigger:
runs-on: ubuntu-latest
steps:
- name: Post GHPRB trigger comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: 'retest this please'
})