Upgrade Ruby and Bundler Version #551
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: Upgrade Ruby Version | |
on: | |
schedule: | |
- cron: '0 21 * * *' # everyday, 21:00 (UTC) | |
workflow_dispatch: | |
jobs: | |
bump_ruby_version: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup rbenv | |
run: | | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
~/.rbenv/bin/rbenv init || true | |
~/.rbenv/bin/rbenv --version | |
git clone https://github.com/rbenv/ruby-build.git "$(~/.rbenv/bin/rbenv root)"/plugins/ruby-build | |
- name: install latest ruby version | |
run: | | |
latest_version=$(~/.rbenv/bin/rbenv install --list | grep -E "^([0-9]+\.){1}[0-9]+(\.[0-9]+)?$" | sort --version-sort --reverse | head -1) | |
~/.rbenv/bin/rbenv install $latest_version | |
~/.rbenv/bin/rbenv local $latest_version | |
- uses: ruby/setup-ruby@v1 | |
# See: https://github.com/peter-evans/create-pull-request/tree/master#reference-example | |
- name: create PR | |
id: create_pull_request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
# See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
# See: https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-537478081 | |
token: ${{ secrets.PAT }} | |
# See: https://github.com/peter-evans/create-pull-request/issues/593 | |
committer: GitHub <[email protected]> | |
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | |
commit-message: '[Scheduled] upgrade ruby version' | |
title: '[Scheduled] upgrade ruby version' | |
body: | | |
Auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request) | |
--- | |
See: https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
branch: cron_upgrade_ruby_version | |
delete-branch: true | |
labels: | | |
dependencies | |
mac | |
# See: https://github.com/peter-evans/create-pull-request/tree/main#auto-merge | |
- name: enable auto-merge | |
if: steps.create_pull_request.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }} | |
merge-method: squash |