Closed Vadorequest closed 4 years ago
Hi @Vadorequest - thanks for opening this. I wasn't aware of this scenario. I think the best step forward will be to investigate ways of supporting the push
trigger to comment on PRs... to perhaps incorporate your example. I'm not sure how high of a priority that investigation will take, but will keep this open for others to chime in.
To solve your problem, perhaps you could set environment variables programmatically as its own step based on scores... using workflow commands.
Meanwhile, supporting the existing prCommentUrl
and passing it down to lighthouse-check
would solve the issue, by providing a simple workaround.
I've played with pull_request
trigger a bit and here are the most annoying limitations I've found:
Thus, we went from push
to pull_request
and went back to push
again, due to the above limitations.
Interesting, thanks for providing that! Right, I understand now - we need to expose prCommentUrl
as an option in this GitHub Action.
That should be pretty simple, I'll make sure this gets in the next update and will report back.
Awesome, thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sorry this took so long. @Vadorequest - You can now manually set commentUrl
like this example. I chose to call it commentUrl
vs prCommentUrl
because it's added on a commit vs on a PR. Released in v2.0.3. Thanks for reporting.
Thanks! Just to clarify, does it need a accessToken
defined? The example uses one, I thought it was only required when using pull_request
mode.
Yes, @Vadorequest - under the hood we still populate prCommentUrl
used by lighthouse-check
. In lighthouse-check
the naming is prCommentUrl
and prCommentAccessToken
, but it's really the just the naming that is bad. Someday, hopefully I can change it to just commentUrl
and commentAccessToken
.
To post comments we use the GitHub REST API directly, and the access token is required for authorization.
That's what I assumed, works like a charm :)
https://github.com/UnlyEd/next-right-now/pull/139#commitcomment-40910846
Awesome!
I'm trying to integrate LH reports within my GH actions.
Our workflow is as follow:
We use the
push
event, becausepull_request
has severe limitations. Because of that, we have to comment on the PR ourselves, becauseprCommentUrl
option doesn't exist.Currently, our comment works, but colors are hardcoded (i.e:
green
) and I wonder how we could easily resolve the right color. I see you're using JS but I'm not familiar with bash and I'm not sure how to avoid code duplication.I know this isn't so much related to
lighthouse-check-action
, but if you know of a good example/tutorial about how to run JS through github actions, it may be helpful.Also, I think the
prCommentUrl
option would be a great addition, for people who cannot usepull_request
trigger.PR: https://github.com/UnlyEd/next-right-now/pull/109