From 0b60c86b1427561b7ca0f252b2b2510cbd174ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 19 Nov 2020 17:51:20 +0000 Subject: [PATCH] feat(ci): upgrade package-lock.json deps on a schedule --- .github/workflows/maintenance.yml | 43 +++++++++++++++++++++++++++++++ ui/Makefile | 5 ++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/maintenance.yml diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml new file mode 100644 index 000000000..439eebf56 --- /dev/null +++ b/.github/workflows/maintenance.yml @@ -0,0 +1,43 @@ +name: Maintenance + +on: + schedule: + - cron: "15 18 * * 4" + +jobs: + npm-upgrades: + name: Regenerate package-lock.json + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Node JS + uses: actions/setup-node@v1 + with: + node-version: 14.15.1 + + - name: Regenerate package-lock.json + run: make -C ui npm-upgrade + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "chore(ui): upgrade all 3rd party dependencies" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: npm-upgrades + + - name: Initialize Pull Request + uses: gha-utilities/init-pull-request@v0.2.0 + with: + verbose: true + pull_request_token: ${{ secrets.GITHUB_TOKEN }} + head: npm-upgrades + base: master + title: "chore(ui): upgrade all 3rd party dependencies" + body: "Automated package-lock.json update" diff --git a/ui/Makefile b/ui/Makefile index 1c15cbd88..b92af00b9 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -61,3 +61,8 @@ format: $(NODE_PATH)/prettier build/stats.json: build source-map-explorer build/static/*/*.{js,css} --json > build/stats.json + +.PHONY: npm-upgrade +npm-upgrade: + rm -fr node_modules package-lock.json + npm install