mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
ci: autofix Dependabot commits (#2394)
* ci: autofix Dependabot commits * Add git push * Update dependabot.js.yml * Update dependabot.js.yml
This commit is contained in:
41
.github/workflows/dependabot.js.yml
vendored
Normal file
41
.github/workflows/dependabot.js.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Dependabot
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dependabot/npm_and_yarn/** ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- 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
|
Reference in New Issue
Block a user