-
-
Notifications
You must be signed in to change notification settings - Fork 53
71 lines (67 loc) · 1.99 KB
/
dependabot-tapioca.yml
File metadata and controls
71 lines (67 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
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"
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:$PR_HEAD_REF