diff --git a/.github/workflows/retrigger-prb-on-ready.yml b/.github/workflows/retrigger-prb-on-ready.yml new file mode 100644 index 0000000000..efa2327d82 --- /dev/null +++ b/.github/workflows/retrigger-prb-on-ready.yml @@ -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' + })