Skip to content

Dependencies Bump

Dependencies Bump #191

name: Dependencies Bump
on:
workflow_call:
secrets:
GPG_PRIVATE_KEY:
required: true
GPG_PASSPHRASE:
required: true
GH_TOKEN:
required: true
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: npm
- name: Install Global Dependencies
run: npm install --global npm-check-updates rimraf
- name: Bump Dependencies
run: ncu --upgrade
- name: Remove package-lock.json
run: rimraf --glob **/package-lock.json
- name: Install Dependencies
run: npm install
- name: Import GPG Key
# cSpell: disable-next-line
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# cSpell: disable-next-line
git_user_signingkey: true
# cSpell: disable-next-line
git_commit_gpgsign: true
- name: 'Create Pull Request'
id: create-pull-request
env:
COMMIT_MESSAGE: 'chore(bot): bump dependencies'
COMMITTER: github-actions[bot] <[email protected]>
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: ${{ env.COMMIT_MESSAGE }}
committer: ${{ env.COMMITTER}}
author: ${{ env.COMMITTER}}
signoff: true
delete-branch: true
branch-suffix: timestamp
title: ${{ env.COMMIT_MESSAGE }}
- name: Auto-Merge Pull Request
if: ${{ steps.create-pull-request.outputs.pull-request-number }}
run: gh pr merge --auto --squash "${{ steps.create-pull-request.outputs.pull-request-url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}