Skip to content

Commit 49f781a

Browse files
authored
Merge pull request #22 from rickreyhsig/rickreyhsig-patch-3
Create update-gemfile-lock.yml
2 parents 6521843 + 0aaa63e commit 49f781a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update Gemfile.lock
2+
3+
on:
4+
push:
5+
paths:
6+
- 'Gemfile'
7+
- '.github/workflows/update-gemfile-lock.yml'
8+
9+
jobs:
10+
update-gemfile-lock:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.ref }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Set up Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: '2.4.2' # Match your Gemfile
24+
25+
- name: Install dependencies and update Gemfile.lock
26+
run: |
27+
bundle install
28+
29+
- name: Check if Gemfile.lock changed
30+
run: |
31+
git diff --exit-code Gemfile.lock || echo "Gemfile.lock updated"
32+
33+
- name: Commit and push if Gemfile.lock changed
34+
run: |
35+
git config --global user.name "github-actions[bot]"
36+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
if ! git diff --quiet Gemfile.lock; then
38+
git add Gemfile.lock
39+
git commit -m "Update Gemfile.lock via GitHub Actions"
40+
git push
41+
fi

0 commit comments

Comments
 (0)