Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR review companion to not run if nothing was uploaded in the PR text #3786

Closed
peterbe opened this issue Apr 2, 2021 · 3 comments · Fixed by #3787
Closed

PR review companion to not run if nothing was uploaded in the PR text #3786

peterbe opened this issue Apr 2, 2021 · 3 comments · Fixed by #3787
Assignees

Comments

@peterbe
Copy link
Contributor

peterbe commented Apr 2, 2021

PR review companion will crash if there was no upload in the "PR test"

E.g. https://github.com/mdn/content/runs/2255769916?check_suite_focus=true

@peterbe
Copy link
Contributor Author

peterbe commented Apr 2, 2021

Here's the "PR test" that started it https://github.com/mdn/content/runs/2255762883?check_suite_focus=true
As you can see it never ran the "Build changed content" step.

@peterbe
Copy link
Contributor Author

peterbe commented Apr 2, 2021

Wow! It's still not supported. At least according to actions/runner#662
But there appears to be some OKish hacks.

@peterbe
Copy link
Contributor Author

peterbe commented Apr 2, 2021

Hmm. So it's possible to "control the error" a bit. I

if (matchArtifacts.length === 0) {
  <<throw or exit non-zero so it bails>>
}

but what's the point?
If there's no way to exit the entire workflow, what's the point of messing around with things like:

      - name: Unzip what was downloaded
+       if: steps.download.conclusion == 'success'

They're not being run anyway if you have an error in the first step.

I think it's quite OK what happened in https://github.com/mdn/content/actions/runs/712480017
It failed on the first step so it didn't run any of the other steps.
It's a bit unfortunate that the redness of the error makes you think something went horribly wrong and needs attention.

For that, I'm going to just re-arrange and rewrite the error because Unhandled error: TypeError: Cannot read property 'id' of undefined looks like it's unintended and not in control.

@peterbe peterbe self-assigned this Apr 2, 2021
escattone pushed a commit that referenced this issue Apr 5, 2021
…#3787)

* PR review companion to not run if nothing was uploaded in the PR text

Fixes #3786

* tidy
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants