Reviews could be automatically dismissed on new commits pushed (there is
an option for that in repository settings on Github). That is not the
case for labels. They remain attached to a PR, even when new commits are
pushed. This is undesirable and creates security concerns, because
someone could introduce untested code just before the automerge happens.
We want to make sure all formulae are readable and pass style checks on
both macOS and Linux.
Why Linux? We're doing increasing numbers of things on Linux (bottle
uploads, formulae.brew.sh generation, etc.) and can no longer have
homebrew-core only work on macOS.
This means that changes that make formulae unreadable on Linux will need
to be fixed (e.g. https://github.com/Homebrew/brew/pull/7470) before the
formula changes are merged.
As a nice side-effect: this should make life easier for linuxbrew-core
maintainers.
- The "potentially fix syntax" commit did not fix it.
- Revert to make `brew pr-publish` work again, so we can ship software
to users.
- Dinner calls, and even though we could probably do an `if` in the main
`script` code, I don't trust myself to write JS well enough after this!
- Sorry folks, 7dcd5e2be6 was bad:
> The workflow is not valid.
> .github/workflows/publish-commit-bottles.yml (Line: 31, Col: 13):
> Unrecognized named-value: 'context'. Located at position 1 within
> expression: context.actor != "BrewTestBot"
- Maybe if it does the `if` after the `uses`, it'll know what `context`
is?
- This was annoying me, and it must have been weird to contributors too,
to have a bot reference itself.
- Since PRs can still be merged with `brew pr-publish` _outside_ of
the auto-merge process, ie if things are particularly urgent, I've
kept this in for human maintainers who trigger the action.
- The "publish failed" message is still useful in all cases.
Closes#53798.
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
- I tried to be too clever. Given that I don't know JS, that was a bad
idea. Let's do this the less elegant but (hopefully) definitely
working way to avoid cryptic errors like:
```
[error]Cookies must be enabled to use GitHub.
```
from [`pr-publish` Actions runs](https://github.com/Homebrew/homebrew-core/runs/583194836?check_suite_focus=true).
- It was probably not entirely clear to users what "bottle pull" meant.
- We can use Markdown style links to make the message shorter.
- Tested in a browser with `console.log()` as that's as far as my JS
goes!
- I went to do my first `brew pr-publish` on a "ready to merge" PR and
it failed, because @dawidd6 had already started.
- We can't expect maintainers to pick through the Actions UI to find
existing Actions that are running for the formula - the UI isn't
that good.
- So this adds a comment to the PR, when the Action starts, to say who
started it. It serves as a warning to other maintainers that it's in
hand and to not try. Unless it fails for some reason.