From 0c9e5dd32a0f4a2b6e683f4c054e5905d2f03afe Mon Sep 17 00:00:00 2001 From: Ben Fairless Date: Tue, 28 Apr 2026 17:16:07 +0800 Subject: [PATCH 1/2] ci: add Dependabot Tapioca workflow --- .github/workflows/dependabot-tapioca.yml | 69 ++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/dependabot-tapioca.yml diff --git a/.github/workflows/dependabot-tapioca.yml b/.github/workflows/dependabot-tapioca.yml new file mode 100644 index 000000000..997a0fc94 --- /dev/null +++ b/.github/workflows/dependabot-tapioca.yml @@ -0,0 +1,69 @@ +name: Dependabot Tapioca + +on: + pull_request: + types: + - opened + - synchronize + - reopened + +permissions: + contents: read + +jobs: + update_tapioca: + if: > + github.actor == 'dependabot[bot]' && + startsWith(github.head_ref, 'dependabot/bundler/') && + github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + services: + postgres: + image: postgis/postgis:15-3.3 + ports: + - 5432:5432 + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + RAILS_ENV: test + DATABASE_URL: "postgis://postgres:postgres@localhost:5432/rails_test" + permissions: + contents: write + concurrency: + group: dependabot-tapioca-${{ github.event.pull_request.number }} + cancel-in-progress: true + steps: + - name: Checkout Dependabot branch + uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1.305.0 + with: + bundler-cache: true + - name: Create database + run: bin/rails db:create + - name: Set up database schema + run: bin/rails db:schema:load + - name: Update Tapioca RBI files + run: | + bin/tapioca gem + bin/tapioca dsl + bin/tapioca dsl --environment=test + - name: Commit updated RBI files + run: | + if git diff --quiet --exit-code -- sorbet; then + echo "No Tapioca changes to commit" + exit 0 + fi + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add sorbet + git commit -m "Update Tapioca RBI files" + git push origin HEAD:${{ github.event.pull_request.head.ref }} From 3a6c59ae7f423cfc3d4effc70d622fd22ff64e47 Mon Sep 17 00:00:00 2001 From: Ben Fairless Date: Tue, 28 Apr 2026 22:41:01 +0800 Subject: [PATCH 2/2] Update Github action to use env variable --- .github/workflows/dependabot-tapioca.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-tapioca.yml b/.github/workflows/dependabot-tapioca.yml index 997a0fc94..51acf70cf 100644 --- a/.github/workflows/dependabot-tapioca.yml +++ b/.github/workflows/dependabot-tapioca.yml @@ -56,6 +56,8 @@ jobs: bin/tapioca dsl bin/tapioca dsl --environment=test - name: Commit updated RBI files + env: + PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} run: | if git diff --quiet --exit-code -- sorbet; then echo "No Tapioca changes to commit" @@ -66,4 +68,4 @@ jobs: git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add sorbet git commit -m "Update Tapioca RBI files" - git push origin HEAD:${{ github.event.pull_request.head.ref }} + git push origin HEAD:$PR_HEAD_REF