So I have these requirements:
main
branch must have merge protection (Require status checks to pass before merging
) based on the status check associated with GitHubActions workflowXYZ
- when I open a PR workflow
XYZ
must be triggered (but not when that PR getssynchronized
, or any other event) - workflow
XYZ
also must be manually triggerable (workflow_dispatch
)
I have setup the workflow in this way
on:
pull_request:
types: [opened]
workflow_dispatch:
and just after opening the PR things are fine.
Problem is that when I push a second/third/fourth commit to the PR AND then start the workflow manually, even if the workflow is successful
the result seems to be not available to the PR (thus preventing merging)
I was able to find this related question Github Actions – Workflow job not setting status check, but unfortunately the final solution does not suit my need, because I don’t want to run the workflow on PR event other than opened
.