Skip to content

Instantly share code, notes, and snippets.

@filipkis
Last active February 8, 2020 17:07
Show Gist options
  • Save filipkis/fab89a09f54ffdd8e70c063755e7ce7f to your computer and use it in GitHub Desktop.
Save filipkis/fab89a09f54ffdd8e70c063755e7ce7f to your computer and use it in GitHub Desktop.
GitHub Action Workflow for updating gems after dependabot push
name: Update Gems After Dependabot
on:
push:
branches:
- 'dependabot/bundler/**'
paths:
- 'Gemfile.lock'
jobs:
update-gems:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.5
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.5
- name: Installing additional dependencies
run: |
sudo apt-get install postgresql-client libpq-dev
- name: Bundle install
run: |
gem install bundler --no-rdoc --no-ri
bundle install
- name: Commit
run: |
git config --local user.email `git show -s --format='%ae'`
git config --local user.name ${GITHUB_ACTOR}
git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
git add .
git commit -m "`git log --oneline --format=%B -n 1 HEAD | head -n 1` - add gems"
git push github HEAD:${GITHUB_REF}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment