-
Bug
-
Resolution: Done
-
Critical
-
None
-
None
The cloud-tests-pr-trigger.yml workflow uses the Github API to trigger the WildFly Cloud Tests workflows. To do this it sends information about the PR under test as a JSON payload.
This payload includes a 'githubSha' attribute, the value of which is meant to be the sha of the GH ephemeral merge commit merging the PR branch into the base branch. The workflow uses the standard GITHUB_SHA env var value as the value of 'githubSha'.
GITHUB_SHA is documented as having a value that varies depending on the event that triggers the workflow.[1] The cloud-tests-pr-trigger workflow uses the 'pull_request_target' event, which is documented as using the head of the PR base branch as the GITHUB_SHA value.[2] The base branch meaning 'main', '34.x', etc.
So, when we push a PR branch we are triggering a test of main, not of the PR.
Switching to the 'pull_request' event would fix this, since for that event the GITHUB_SHA value is the sha of the merge commit.[3]
But there likely is a technical reason using the more intuitive 'pull_request' wasn't chosen, i.e. the event needs to run in the context of the base of the pull request. Probably so it has access to the token secret needed to authenticate the GH API call to trigger the tests. If so, we'll need to figure out a different way to identify the data to include in the JSON.