Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Fix unnamed workflow on pull request #65

Merged
merged 1 commit into from
Jun 17, 2020

Conversation

dbalcomb
Copy link
Contributor

@dbalcomb dbalcomb commented May 5, 2020

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.

@fbecart
Copy link

fbecart commented May 17, 2020

My project is having the same issue https://github.com/fbecart/zinoma/actions
Of course it's not blocking, but a fix would be welcome.

@dbalcomb Can I help testing this PR? If so, could you give me some indication how to proceed?

@dbalcomb
Copy link
Contributor Author

@fbecart After some further thought I don't think that additional testing is necessary but it would be good to get input from the developer of the action.

@svartalf Could you take a look at this? I see that you are working on the actions-rs/clippy action as a replacement for this one. I am not entirely sure how it differs but it would be good to see this fix landed in the meantime. Assuming that you approve of course.

@svartalf
Copy link
Member

Hey, @dbalcomb! Sorry for not getting back to you earlier.

In a current state actions-rs/clippy is nothing more than an experiment; I wanted to check if it would be possible right not do the same what this Action does, but without requiring GITHUB_TOKEN and communicating with GH API.
It's kinda possible by abusing undocumented things, but whole approach is very ugly overall, so it's not like this Action will be deprecated soon and your fix is definitely an amazing finding!

It looks fine for me, so I'll merge and publish it tomorrow. Thank you for debugging this thing :)

@pitkley
Copy link

pitkley commented May 27, 2020

I quickly wanted to mention that I tested this PR and can confirm that the annotations are now associated with the correct check for pull-requests. 👍

pitkley added a commit to pitkley/actions-rs-core that referenced this pull request May 28, 2020
@svartalf svartalf merged commit 23e51b2 into actions-rs:master Jun 17, 2020
@svartalf
Copy link
Member

This fix was published in v1.0.7 and can be used now as latest actions-rs/clippy-check@v1 tag.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants