File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments