FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Only report the first CheckoutWrongHead lint error by simon-engledew · Pull Request #348 · github/codeql-action · GitHub

Only report the first CheckoutWrongHead lint error - #348

Merged
simon-engledew merged 4 commits into
mainfrom
simon-engledew/checkout-wrong-heads
Jan 4, 2021
Merged

simon-engledew merged 4 commits into
mainfrom
simon-engledew/checkout-wrong-heads

Conversation

simon-engledew commented Dec 21, 2020
edited
Loading

Copy link
Copy Markdown

Some people are running git checkout HEAD^2 many times during their workflow.

To look a bit tidier, this will only warn them once instead of one warning for each instance.

simon-engledew force-pushed the simon-engledew/checkout-wrong-heads branch from 28a9315 to e89a24b Compare December 21, 2020 11:09

robertbrignull left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The actual code change looks fine. I don't think we use break with named labels anywhere else, but eslint isn't complaining so it's apparently within our style guide. I don't have a problem with it.

I do wonder why people would be running it multiple times. That's weird and definitely not something we've recommended or included in our default workflows. Do you have an example repo where you've seen this?

Worth nothing that git checkout HEAD^2 is not idempotent, so it's definitely different from just including it once. So from that point of view I wonder if we should warn them at all since they're clearly doing something unusual. But then also I can't think why you would legitimately want to run it multiple times, so perhaps we should warn them and prompt them to change their workflow because it's weird.

Copy link
Copy Markdown
Author

I do wonder why people would be running it multiple times. That's weird and definitely not something we've recommended or included in our default workflows. Do you have an example repo where you've seen this?

Thanks for the prompt! I had a double check and it happens when there are multiple jobs all using the same anti-pattern.

All the linting we do is global accept this so it was polluting the lint output of other jobs. I've improved the fix so that it reports the issue to the job which includes it.

simon-engledew merged commit b1e0b46 into main Jan 4, 2021
simon-engledew deleted the simon-engledew/checkout-wrong-heads branch January 4, 2021 14:19
github-actions Bot mentioned this pull request Jan 11, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL