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
.github/workflows: add action to update tapioca definitions #8283
Conversation
Is this related to |
Still the same problem where we can't push even from a not-forked PR. It's trying to push over HTTPS, which requires a GitHub username and a personal access token. We've got the token, which should work fine (tho I can't see what scopes it has). I wonder if there's a way to specify the username. Or we could |
Oh good, at least this is a different error! |
OK, so we're getting further, it's trying to push, has the right credentials, but can't push:
🤯 |
You can't push to BrewTestBot's repository using GITHUB_TOKEN. |
This existing workflow already works, so you should be able to copy what it's doing without much modification: https://github.com/Homebrew/brew/blob/master/.github/workflows/spdx.yml |
cf33535
to
48d97cb
Compare
@jonchang We're trying to push to |
From @Bo98 in Slack:
We'll have to merge this (or preferably #8233) as-is and wait three days - which shouldn't be a problem given it's the same as the License Action and we know the commands work. |
Because this new workflow is triggered on the
Step 2 needs to be restricted where the GITHUB_REF is |
I just noticed this: also need to use |
|
This isn't quite right. It's fine to run on |
08fce57
to
d30f615
Compare
After much head-scratching (thanks so much to everyone who offered their opinions!), this finally generated a PR! 🎉 Here it is: #8361 I had to remove the date specifier for the branch as I couldn't set it dynamically to the current date in the I'll leave this open for a bit so people can check it's not doing anything weird, or if people have ideas for improvements. EDIT: One thing I notice is CI doesn't appear to have triggered on the above test PR. |
Yeah, I don't think CI is triggered by @github-actions. We had the same problem here: Homebrew/homebrew-cask-fonts#2253 (comment) |
Does setting an output variable and using it as a substitution like |
To summarise the current status of this:
|
I'm not sure |
Ohh. I thought I pulled that as an example from the License action, but it turns out that I read the line wrong and it's the other way around. Either way, we want to raise PRs as |
I think it would be nice to use some sort of unique branch identifier OR to force-push to the existing branch name if there's changes rather than failing the workflow.
It is not. If someone can let me know what rights it needs: I can add it. |
.github/workflows/tapioca-update.yml
Outdated
cd "$GITHUB_WORKSPACE/Library/Homebrew" | ||
bundle install | ||
bundle exec tapioca sync --exclude json | ||
bundle exec srb rbi hidden-definitions | ||
if ! git diff --exit-code -- sorbet; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd "$GITHUB_WORKSPACE/Library/Homebrew" | |
bundle install | |
bundle exec tapioca sync --exclude json | |
bundle exec srb rbi hidden-definitions | |
if ! git diff --exit-code -- sorbet; then | |
cd "$GITHUB_WORKSPACE/Library/Homebrew" | |
bundle install | |
bundle exec tapioca sync --exclude json | |
bundle exec srb rbi hidden-definitions | |
if ! git diff --exit-code -- sorbet; then |
I presume this can all be done by #8289? If not: it'd be good to add so a single command can be run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidusheeamoli How would you feel about integrating these Tapioca update commands into brew typecheck
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@issyl0 On it!
We need this Action to be able to use a |
Why is this the case? |
@Bo98, I think it's to avoid recursive actions. You cannot trigger actions with the default |
@vidusheeamoli @issyl0 Check out https://github.com/Homebrew/formulae.brew.sh/blob/master/.github/workflows/scheduled.yml and https://github.com/Homebrew/rubydoc.brew.sh/blob/master/.github/workflows/scheduled.yml. I've updated them recently to use Homebrew's actions as much as possible and they should just need use the @BrewTestBot token (as mentioned above). |
- Tapioca is a companion gem to Sorbet that generates RBI files for the Ruby gems in a project. - Whenever Dependabot updates a gem, Tapioca has to regenerate that gem's RBI files so that Sorbet can accurately assess the state of the typing of a codebase. - We also must regenerate Sorbet's view of [things defined at runtime](https://sorbet.org/docs/rbi#the-hidden-definition-rbi): this is what it calls `hidden-definitions`. - Obviously, this got tedious to do manually. So here's an Action that runs every three days and raises a PR if there are any changes. Co-authored-by: Vidushee Amoli <vidushee.amoli@gmail.com> Co-authored-by: Issy Long <me@issyl0.co.uk> Co-authored-by: Jonathan Chang <jchang641@gmail.com> Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
…ot's) - The github-actions[bot] PRs don't to trigger CI runs, and are hence unmergeable without manual intervention.
- This'll stop needs-response[bot] from moaning at us.
6acae40
to
b7ec432
Compare
57d5e67
to
fdda447
Compare
fdda447
to
1d3adda
Compare
It's working: #8420 |
brew style
with your changes locally?brew tests
with your changes locally?This is a test of the changes of #8233, but raised from a branch on the main repo, not from a fork, so that the Actions run has access to the secrets. Let's see if it works!
We're expecting to see a PR raised by
BrewTestBot
.