GitHubActions manually triggered workflow not publishing result

  Kiến thức lập trình

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 workflow XYZ
  • when I open a PR workflow XYZ must be triggered (but not when that PR gets synchronized, 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
result_is_pass

the result seems to be not available to the PR (thus preventing merging)
result_not_available_to_PR

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.

LEAVE A COMMENT