From 3250a83e5aaf1465f127dea01caaaf67b13a51c4 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Wed, 12 Jan 2022 11:40:11 +0000 Subject: [PATCH] Automate updating 3rd party licenses (#82) --- .../workflows/update_3rd_party_licenses.sh | 13 +++++++++++++ .../workflows/update_3rd_party_licenses.yml | 19 +++++++++++++++++++ package.json | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 .github/workflows/update_3rd_party_licenses.sh create mode 100644 .github/workflows/update_3rd_party_licenses.yml diff --git a/.github/workflows/update_3rd_party_licenses.sh b/.github/workflows/update_3rd_party_licenses.sh new file mode 100755 index 0000000..e45e1ea --- /dev/null +++ b/.github/workflows/update_3rd_party_licenses.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -eux + +git config user.name "GitHub Actions" +git config user.email "actions@user.noreply.github.com" +git checkout main + +npm run licenses + +git add 3RD_PARTY_LICENSES +git commit -m "Update 3rd party licenses" || true +git push origin diff --git a/.github/workflows/update_3rd_party_licenses.yml b/.github/workflows/update_3rd_party_licenses.yml new file mode 100644 index 0000000..25a949a --- /dev/null +++ b/.github/workflows/update_3rd_party_licenses.yml @@ -0,0 +1,19 @@ +--- +name: update_3rd_party_licenses + +on: + schedule: + - cron: '0 12 * * *' + workflow_dispatch: + +jobs: + update: + name: Update 3rd party licenses + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '14' + - run: + ./.github/workflows/update_3rd_party_licenses.sh diff --git a/package.json b/package.json index d6cd7e3..ab68a40 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "jslint": "eslint src/**/*.js && eslint __tests__/**/*.js", "licenses": "yarn licenses generate-disclaimer > 3RD_PARTY_LICENSES", "markdownlint": "markdownlint *.md", - "shellcheck": "shellcheck src/install-*.sh", + "shellcheck": "shellcheck src/install-*.sh .github/workflows/*.sh", "test": "node __tests__/setup-beam.test.js && node ./__tests__/problem-matchers.test.js", "yamllint": "yamllint .github/workflows/**.yml && yamllint .*.yml && yamllint *.yml" },