-
Notifications
You must be signed in to change notification settings - Fork 257
67 lines (57 loc) · 2.18 KB
/
update-dependencies.yml
File metadata and controls
67 lines (57 loc) · 2.18 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
name: update-dependencies
permissions: read-all
on:
repository_dispatch:
types: [update-dependency]
workflow_dispatch:
inputs:
target_submodule:
description: 'Submodule to update'
required: true
type: string
target_version:
description: 'Version of the submodule to update to'
required: true
type: string
jobs:
update-dependencies:
runs-on: macos-latest
permissions:
contents: write
pull-requests: write
env:
SUBMODULE: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.target_submodule || inputs.target_submodule }}
VERSION: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.target_version || inputs.target_version }}
BUNDLE_GITHUB__COM: ${{ secrets.BUNDLE_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REVIEWER: gingerbenw
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: next
- run: |
git config --global user.name 'Bumpsnag bot'
git config --global user.email ''
- run: git fetch --prune --unshallow
- run: git submodule update --init --recursive
- name: Install ruby
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: 2.7
- name: Install dependencies
run: bundle install
- name: Update references locally
run: TARGET_SUBMODULE=$SUBMODULE TARGET_VERSION=$VERSION bundle exec scripts/update-dependencies.rb
- name: Commit and push changes
run: BUMPSNAG_TARGET_HEADING="[Unreleased]" bundle exec bumpsnag commit-update $SUBMODULE $VERSION
- name: List current branch name
id: current-branch
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
- name: Create pull request
if: ${{ steps.current-branch.outputs.branch != 'next'}}
run: >
gh pr create -B next
-H bumpsnag-$SUBMODULE-$VERSION
--title "Update $SUBMODULE to version $VERSION"
--body 'Created by bumpsnag'
--reviewer $REVIEWER