Skip to content

Commit 4988868

Browse files
authored
Add workflow to bump Bundler version automatically
1 parent 068ac1a commit 4988868

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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: read
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+
- name: Check for changes
25+
run: |
26+
if git diff --quiet; then
27+
echo "changes=false" >> $GITHUB_ENV
28+
else
29+
echo "changes=true" >> $GITHUB_ENV
30+
fi
31+
- name: Commit changes
32+
if: env.changes == 'true'
33+
run: |
34+
git config user.name "ari-wg-gitbot"
35+
git config user.email "[email protected]"
36+
git add .
37+
git commit -m "Bump Bundler Version in Gemfile.lock"
38+
- name: Create or Update Pull Request
39+
if: env.changes == 'true'
40+
uses: peter-evans/create-pull-request@v7
41+
with:
42+
branch: bump-bundler-version-${{ github.ref_name }}
43+
title: "Automated Bump of Bundler Version in Gemfile.lock"
44+
labels: "needs_review"

0 commit comments

Comments
 (0)