Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dentarg/bump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bump

A GitHub Action that updates a Ruby gem using bundler and opens a pull request with the changes.

Usage

This action is designed to be used with workflow_dispatch to manually trigger gem updates. Add the following workflow to your repository.

Also enable Allow GitHub Actions to create and approve pull requests in repository settings.

name: Bump Gem

on:
  workflow_dispatch:
    inputs:
      gem_name:
        description: 'Name of the Ruby gem to update'
        required: true
        type: string
      update_type:
        description: 'Update type (major, minor, patch)'
        required: false
        type: choice
        options:
          - ''
          - major
          - minor
          - patch
      pre:
        description: 'Include pre-release versions'
        required: false
        type: boolean
        default: false
      gem_version:
        description: 'Specific version to update to'
        required: false
        type: string

jobs:
  bump:
    runs-on: ubuntu-latest
    steps:
      - uses: dentarg/bump@main
        with:
          gem_name: ${{ inputs.gem_name }}
          update_type: ${{ inputs.update_type }}
          pre: ${{ inputs.pre }}
          gem_version: ${{ inputs.gem_version }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          labels: dependencies

To be able to trigger further workflow runs, the pull requests created are marked as draft, so you can use the ready_for_review trigger in your workflows to have them run when you mark the pull request as ready.

name: CI

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review] # this includes the defaults

jobs:
  specs:
    runs-on: ubuntu-latest
    steps:
    - run: my-test-command

Inputs

See action.yml.

How it works

  1. The Ruby version needs to be specified in Gemfile.lock
  2. The action runs bundle update --conservative <gem_name> to update only the specified gem and its dependencies
  3. If there are changes to Gemfile.lock, it creates a pull request with the updates
  4. The PR includes a descriptive title and body explaining the changes

Development

# test main
bin/test

# test pull-request
bin/test <pull-request number>

# cleanup pull-request created from testing
bin/del <pull-request number>

# squash merge pull-request
bin/merge-pr <pull-request number>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •