Skip to content

Instantly share code, notes, and snippets.

@giuseppeg
Created September 5, 2021 09:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giuseppeg/0ef7da2cb168ee4e3bb669b823fd0f67 to your computer and use it in GitHub Desktop.
Save giuseppeg/0ef7da2cb168ee4e3bb669b823fd0f67 to your computer and use it in GitHub Desktop.
github workflow (action) to update dependencis
name: Update Dependencies
on:
schedule:
# https://crontab.guru/#0_0_*_*_WED,SAT
# Run every Wednesday and Saturday at 00:00
# 0 0 * * WED,SAT
- cron: '0 0 * * WED,SAT'
jobs:
dependabot:
runs-on: ubuntu-latest
name: Update Dependencies
steps:
- name: Checkout master
uses: actions/checkout@master
- name: Check outdated dependencies and prepare
run: |
git config user.name 'Dependabot'
git config user.email 'dependabot@users.noreply.github.com'
yarn outdated || yarn upgrade && git add . && git commit -m "Update Dependencies"
- name: Create PR
if: ${{ success() }}
uses: peter-evans/create-pull-request@v3
with:
title: Update Dependencies
body: |
Automatic dependencies upgrade.
Note: major version updates were not installed. After merging this PR run yarn outdate to see if there is any major version.
branch: update-dependencies
branch-suffix: timestamp
delete-branch: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment