Regular Ruby and Bundler version update check #550
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Regular Ruby and Bundler version update check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "5 0 * * *" | |
jobs: | |
update-ruby: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Extract the version of ruby | |
run: | | |
base=$(grep -Po '(?<=FROM )([^\s]*)(?= AS build)' Dockerfile) | |
docker run --rm -u 0 "${base}":latest sh -c " | |
microdnf module enable ruby:3.3 > /dev/null; | |
microdnf repoquery ruby --info | grep Version | awk '{ print \$3 }' | head -1 > .ruby-version; | |
cat .ruby-version" > .ruby-version | |
- name: Commit if the version has changed | |
run: | | |
git config user.name 'Update-a-Bot' | |
git config user.email '[email protected]' | |
git add .ruby-version | |
git commit -m "chore(devel): update .ruby-version" || echo "No new changes" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: 'chore(devel): update .ruby-version' | |
update-bundler: | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_FORCE_RUBY_PLATFORM: true | |
BUNDLE_BUILD__FFI: "--enable-system-libffi" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Ruby and install gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
bundler: latest | |
- name: Update bundler | |
run: bundle config set frozen false && bundle update --bundler | |
- name: Commit if the version changed | |
run: | | |
git config user.name 'Update-a-Bot' | |
git config user.email '[email protected]' | |
git add Gemfile.lock | |
git commit -m "chore(deps): update bundler version" || echo "No new changes" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: 'chore(deps): update bundler version' |