amannn / action-semantic-pull-request

A GitHub Action that ensures that your PR title matches the Conventional Commits spec
MIT License
957 stars 120 forks source link

Reported many times in checks #5

Closed novascreen closed 4 years ago

novascreen commented 4 years ago

Same as: https://github.community/t5/GitHub-Actions/Action-showing-up-several-times-in-quot-checks-quot/td-p/40385

If the first check fails, it will always stay there as failed, so I can't make this a required check.

image

amannn commented 4 years ago

Hi @novascreen,

Thanks for the report!

I noticed that behaviour as well. What I'm currently doing as a workaround is re-running the failed check.

I think ideally when the check runs, it would delete previous checks from semantic-pull-request so that only one remains. A quick research shows that this doesn't work however.

I think what should be possible somehow is to re-request a check. https://developer.github.com/v3/checks/ mentions a rerequested event and I found some documentation that mentions "updating a check run".

Would you be interested in looking into this?

derberg commented 4 years ago

FYI, because of https://github.com/amannn/action-semantic-pull-request/blob/132e039fa405f9c08a75d867067ef051cef58f6a/src/index.js#L35 this GH action cannot be used in a "fork" workflow because of https://github.com/actions/labeler/issues/12#issuecomment-544546826

hanno-jonlay commented 4 years ago

Just to mention that I've been exploring a few semantic PR actions, and this appears to be a common challenge. In case you didn't spot it, posting a link to another action where there is discussion of the same problem: https://github.com/aslafy-z/conventional-pr-title-action/issues/17

(Sorry to not come with a solution - just updating the issue with more context)

zeke commented 4 years ago

Hey there. I'm looking into migrating to this Action so I can wean myself (and lots of other people) off my https://github.com/zeke/semantic-pull-requests GitHub App. I noticed this double-check thing though and would want to make sure that's resolved before switching over.

(And like @hanno-jonlay, I'm also not offering a solution at this point, just adding context. 🙈)

zeke commented 4 years ago

I consulted the internal GitHub Actions support team and asked them to take a look at this. It turns out this may be caused by a long-standing issue in Actions itself. I will keep an eye on that internal issue and report back here as it progresses.

amannn commented 4 years ago

@zeke Oh that's fantastic, thank you so much for your help!

I found something in the docs about updating a check run, but I didn't have time to look into that yet. There's also a disclaimer that this feature is in preview and might change in the future.

amannn commented 4 years ago

It seems like this is no longer the case. Re-runs now update the previous status for me and the failed check is removed. Can someone confirm?

zeke commented 4 years ago

I just tried it out on this public repo: https://github.com/zeke/nearby-cities/pull/7 and it worked! 🎉

I see two checks coming from this Action, but pushing new commits or making changes to the PR title does NOT cause the checks to pile up, as before:

Screen Shot 2020-08-13 at 6 28 22 PM

I also confirmed that the check is failing when the PR title is not semantic:

Screen Shot 2020-08-13 at 6 27 28 PM

From my perspective, I think this issue can be closed.

amannn commented 4 years ago

@zeke That's great – thanks for verifying!

The action causing two checks is expected: One is the check of the PR title itself (can succeed or fail) and the other one is for keeping a pending check when the PR has the [WIP] prefix (can be pending or successful).

Maybe it's possible to unify that, or at least to add the second check only if the PR was WIP before, but I think this particular issue can be closed 🙂 .

mikehardy commented 4 years ago

@derberg with the new "pull_request_target" action, this should be usable in fork workflows now https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/