-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update tapioca definitions when updating gems #5962
Comments
👋 Hey there. Totally valid request, but I think the best way to tackle this is not via Dependabot but rather setup a GitHub action that watches for Dependabot PR's and then adds a follow-on commit running Here's an example action to help you get started hacking: https://github.com/dependabot/fetch-metadata/ Although ☝️ is probably more complicated than what you're looking for, it should be easy to strip it down to only what you need. |
Thanks - that works well enough. If anyone else runs into this, this workflow seems to work well enough for us: name: Dependabot Tapioca updates
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: write
pull-requests: read
jobs:
build:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
- uses: actions/checkout@v3
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'bundler' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: ruby/setup-ruby@v1
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'bundler' }}
with:
ruby-version: '3.1.2'
bundler-cache: true
- name: Tapioca update
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'bundler' }}
run: bin/tapioca gem
- name: git update
if: ${{ steps.dependabot-metadata.outputs.package-ecosystem == 'bundler' }}
run: |
git config --global user.name 'some user'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git add sorbet/rbi/gems
git commit -m "updated tapioca definitions" sorbet/rbi/gems
git push -u origin HEAD:${{ github.event.pull_request.head.ref }} |
Glad to hear it. Thanks for circling back to share your solution with others. |
@fcheung thank you for sharing your solution. By any chance, did you have to do any extra configuration of your Github Actions? The commit back to the branch works, but Github Actions doesn't trigger off the pushed commit for me. |
Are you using a PAT? Because otherwise you can't trigger a GitHub action from a GitHub action: |
Ahh thank you for the link @jeffwidman! This matches my problem. |
Is there an existing issue for this?
Feature description
I use sorbet in my rails applications, in conjunction with tapioca. Amongst other things, tapioca generates rbi files for all the gems you use, so that sorbet is aware of them. A consequence of this is that when adding/updating gems you need to run
to regenerate those rbi files as required.
Could dependabot do this for me whenever updating gems? Removing manual repetitive steps in updates is exactly what I look to dependabot for.
The text was updated successfully, but these errors were encountered: