From 6afffb2e300ee987ca3908761660e32ef20cd8a7 Mon Sep 17 00:00:00 2001 From: Patrick Ellis Date: Thu, 2 Sep 2021 14:20:15 +0200 Subject: [PATCH] combine license workflow files into one and simplify some naming --- .github/workflows/check_license_status.yml | 32 ------------ .../workflows/update_and_check_licenses.yml | 50 +++++++++++++++++++ .github/workflows/update_license_cache.yml | 32 ------------ 3 files changed, 50 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/check_license_status.yml create mode 100644 .github/workflows/update_and_check_licenses.yml delete mode 100644 .github/workflows/update_license_cache.yml diff --git a/.github/workflows/check_license_status.yml b/.github/workflows/check_license_status.yml deleted file mode 100644 index d42caa33..00000000 --- a/.github/workflows/check_license_status.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Fails if any of our dependencies have licenses that our incompatible with our -# requirements (see .licensed.yml) OR if any of our dependencies have been -# upgraded to a new version without us having updated their corresponding -# license metadata file in .licenses/ -# -# see https://github.com/actions/labeler/pull/91 for more context - -name: Check License Status - -on: - push: - branches: - - main - - licensed_cache_update - pull_request: - branches: - - main - -jobs: - check_license: - needs: update_licenses_cache - if: always() # always run after we update the license cache. if it failed, we will probably just fail as well - runs-on: ubuntu-latest - name: Check License Status - steps: - - uses: actions/checkout@v2 - - uses: jonabc/setup-licensed@v1.0.2 - with: - version: '2.x' - github_token: ${{ secrets.GITHUB_TOKEN }} - - run: npm install - - run: licensed status diff --git a/.github/workflows/update_and_check_licenses.yml b/.github/workflows/update_and_check_licenses.yml new file mode 100644 index 00000000..1cb1f372 --- /dev/null +++ b/.github/workflows/update_and_check_licenses.yml @@ -0,0 +1,50 @@ +name: Licenses + +on: + push: + branches: [main] + paths: [package.json, package-lock.json] + pull_request: + branches: [main] + paths: [package.json, package-lock.json] + workflow_dispatch: + +jobs: + # Updates our cache of license files in response to changes to our dependencies + # declared in package-lock.json. Automatically commits the changes and pushes + # them to your branch. NB `check_license_status` should always run *after* this + # + # see https://github.com/actions/labeler/pull/155 for more context + update_licenses: + runs-on: ubuntu-latest + name: Update Licenses + steps: + - uses: actions/checkout@v1 + - uses: jonabc/setup-licensed@v1 + with: + version: '2.x' + github_token: ${{ secrets.GITHUB_TOKEN }} + - run: npm install --production + - uses: jonabc/licensed-ci@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + # Fails if any of our dependencies have licenses that our incompatible with our + # requirements (see .licensed.yml) OR if any of our dependencies have been + # upgraded to a new version without us having updated their corresponding + # license metadata file in .licenses/ + # + # see https://github.com/actions/labeler/pull/91 for more context + check_licenses: + needs: update_licenses + if: always() # always run after we update the license cache. if it failed, we will probably just fail as well + runs-on: ubuntu-latest + name: Check Licenses + steps: + - uses: actions/checkout@v2 + - uses: jonabc/setup-licensed@v1.0.2 + with: + version: '2.x' + github_token: ${{ secrets.GITHUB_TOKEN }} + - run: npm install + - run: licensed status diff --git a/.github/workflows/update_license_cache.yml b/.github/workflows/update_license_cache.yml deleted file mode 100644 index e41251f7..00000000 --- a/.github/workflows/update_license_cache.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Updates our cache of license files in response to changes to our dependencies -# declared in package-lock.json. Automatically commits the changes and pushes -# them to your branch. NB `check_license_status` should always run *after* this -# -# see https://github.com/actions/labeler/pull/155 for more context - -name: Update License Cache - -on: - push: - branches: - - main - paths: [package-lock.json] - pull_request: - branches: main - paths: package-lock.json - workflow_dispatch: - -jobs: - update_licenses_cache: - runs-on: ubuntu-latest - name: Update License Cache - steps: - - uses: actions/checkout@v1 - - uses: jonabc/setup-licensed@v1 - with: - version: '2.x' - github_token: ${{ secrets.GITHUB_TOKEN }} - - run: npm install --production - - uses: jonabc/licensed-ci@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }}