Files
KaTeX/.github/workflows/dependabot.yml
ylemkimon 06f2f0d706 ci: fix Dependabot autofix (#2400)
* ci: fix Dependabot autofix

* Rename dependabot.js.yml to dependabot.yml
2020-08-10 09:27:43 +09:00

44 lines
1.2 KiB
YAML

name: Dependabot
on:
push:
branches: [ dependabot/npm_and_yarn/** ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Autofix lockfile
run: |
# restore yarn.lock from the previous commit
git checkout HEAD^ -- yarn.lock
# install yarn-plugin-deduplicate
yarn plugin import https://raw.githubusercontent.com/eps1lon/yarn-plugin-deduplicate/latest/bin/%40yarnpkg/plugin-deduplicate.js
# if package.json was not updated, upgrade the dependency
git diff --name-only HEAD^ HEAD | grep -q 'package.json' || yarn up `git log -1 --pretty=%s | awk '{ print $3 }'`
# restore package.json from the last commit
git checkout HEAD -- package.json
yarn install
# deduplicate lockfile
yarn deduplicate
- name: Commit changes
run: |
git add yarn.lock
git config --global user.name 'dependabot[bot]'
git config --global user.email '49699333+dependabot[bot]@users.noreply.github.com'
git commit -m "Dependabot autofix [skip netlify]"
git push