Skip to content

Commit 1832387

Browse files
committed
Add workflow to bump Bundler version automatically
1 parent 068ac1a commit 1832387

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Bump Bundler Version
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.ruby-version'
9+
10+
jobs:
11+
bump-bundler:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
steps:
17+
- uses: hmarr/debug-action@v3
18+
- uses: actions/checkout@v5
19+
- uses: ./.github/workflows/composite/setup
20+
- name: Update BUNDLED WITH in Gemfile.lock
21+
run: |
22+
BUNDLER_VERSION=$(ruby -rbundler -e 'puts Bundler::VERSION')
23+
bundle update --bundler=$BUNDLER_VERSION
24+
cd docs/v3
25+
bundle update --bundler=$BUNDLER_VERSION
26+
- name: Check for changes
27+
run: |
28+
if git diff --quiet; then
29+
echo "changes=false" >> $GITHUB_ENV
30+
else
31+
echo "changes=true" >> $GITHUB_ENV
32+
fi
33+
- name: Commit changes
34+
if: env.changes == 'true'
35+
run: |
36+
git config user.name "ari-wg-gitbot"
37+
git config user.email "[email protected]"
38+
git add .
39+
git commit -m "Bump Bundler Version in Gemfile.lock"
40+
- name: Create or Update Pull Request
41+
if: env.changes == 'true'
42+
uses: peter-evans/create-pull-request@v7
43+
with:
44+
branch: bump-bundler-version-${{ github.ref_name }}
45+
title: "Automated Bump of Bundler Version in Gemfile.lock"
46+
labels: "needs_review"

0 commit comments

Comments
 (0)