This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This attempts to fix the issue where the check run appears under (Unnamed workflow) in the actions tab when triggered by a pull request.
Examples of this can be found on the following repositories:
It appears that the reason is due to the pull request workflow running on a short-lived merge commit. When the UI tries to display the workflow it shows as (Unknown event) and (Unnamed workflow) because it cannot find any reference to the commit SHA.
Fortunately the context payload includes the pull request information so this simply changes the check to use the pull request head SHA when available.
I have successfully tested this on a pull request workflow but it might need some further testing. Specifically according to the event types & payloads documentation there are pull request review and pull request review comment events which also include the pull request in the payload. According to the events that trigger workflows they also use a merge commit. I suppose that it cannot hurt as if there is no merge commit then the default SHA will be the same as the pull request head SHA.
This may also be related to #45.