-
Notifications
You must be signed in to change notification settings - Fork 241
45 lines (41 loc) · 1.51 KB
/
dependabot_update_rbis.yml
File metadata and controls
45 lines (41 loc) · 1.51 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
name: Update gem RBIs on Dependabot PRs
on: workflow_call
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
update-gem-rbis:
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout PR branch
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
- uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
id: setup
with:
bundler-cache: true
- name: Update gem RBIs
run: |
bin/tapioca gem
- name: Check for modified files
id: git_modified_files_check
# If there are changes in the sorbet directory, `echo -n` will return true (zero exit code)
run: |
status=$(git status sorbet --porcelain=v1)
echo "changes=$([ -n "$status" ]; echo $?)" >> $GITHUB_OUTPUT
- name: Push changes
if: ${{ steps.git_modified_files_check.outputs.changes == 0 }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add sorbet/*
date="$(date -u +"%Y-%m-%d")"
git commit -m "Update RBI files for gems ${date} [dependabot skip]"
git push