Update Deps #2
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: Update Deps | |
on: | |
schedule: | |
# https://crontab.guru | |
- cron: 0 0 1 * * | |
workflow_dispatch: | |
inputs: | |
dryRun: | |
description: 'Dry Run' | |
default: true | |
required: true | |
type: boolean | |
changeLog: | |
description: 'Collect Change Log' | |
default: false | |
required: true | |
type: boolean | |
push: | |
description: 'Allow Git Push' | |
default: true | |
required: true | |
type: boolean | |
commit: | |
description: 'Allow Git Commit' | |
default: true | |
required: true | |
type: boolean | |
all: | |
description: 'Relate All Package' | |
default: false | |
required: true | |
type: boolean | |
version: | |
description: 'Update Version(major.minor.patch)' | |
default: 'patch' | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup cache for Chromium binary | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/puppeteer/chrome | |
key: chromium-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set node version to latest | |
uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Checkout main | |
run: git checkout main | |
- name: Sanity check | |
run: | | |
echo branch `git branch --show-current`; | |
echo node `node -v`; | |
echo node `pnpm -v`; | |
- name: Set git config | |
run: | | |
git config pull.rebase false | |
git config --global user.email "update-workflow@*.*" | |
git config --global user.name "Update Workflow" | |
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }} | |
- name: Run init | |
run: npm run init | |
# schedule: npm run update -- --major --no-dry-run --no-push --no-commit | |
- name: Run update | |
run: >- | |
npm run update -- | |
--${{ inputs.version || 'major' }} | |
${{ !contains(inputs.dryRun, 'true') && '--no-dry-run' || '' }} | |
${{ !contains(inputs.push, 'true') && '--no-push' || '' }} | |
${{ !contains(inputs.commit, 'true') && '--no-commit' || '' }} | |
${{ contains(inputs.all, 'true') && '--all' || '' }} | |
${{ contains(inputs.changeLog, 'false') && '--no-change-log' || '' }} | |