Merge branch 'main' into main

This commit is contained in:
Josh Dales
2022-06-11 07:30:44 -04:00
committed by GitHub
14 changed files with 1520 additions and 1389 deletions

View File

@@ -19,10 +19,10 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Setup node 14
- name: Setup node 16
uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 16.x
- run: npm install
- run: npm run build
- run: npm test

View File

@@ -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

View File

@@ -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: '3.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: '3.x'
github_token: ${{ secrets.GITHUB_TOKEN }}
- run: npm install
- run: licensed status

View File

@@ -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 }}

View File

@@ -1,6 +1,6 @@
---
name: "@actions/core"
version: 1.4.0
version: 1.6.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@@ -1,6 +1,6 @@
---
name: node-fetch
version: 2.6.1
version: 2.6.7
type: npm
summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch

30
.licenses/npm/tr46.dep.yml generated Normal file
View File

@@ -0,0 +1,30 @@
---
name: tr46
version: 0.0.3
type: npm
summary: An implementation of the Unicode TR46 spec
homepage: https://github.com/Sebmaster/tr46.js#readme
license: mit
licenses:
- sources: Auto-generated MIT license text
text: |
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []

23
.licenses/npm/webidl-conversions.dep.yml generated Normal file
View File

@@ -0,0 +1,23 @@
---
name: webidl-conversions
version: 3.0.1
type: npm
summary: Implements the WebIDL algorithms for converting to and from JavaScript values
homepage:
license: bsd-2-clause
licenses:
- sources: LICENSE.md
text: |
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
notices: []

32
.licenses/npm/whatwg-url.dep.yml generated Normal file
View File

@@ -0,0 +1,32 @@
---
name: whatwg-url
version: 5.0.0
type: npm
summary: An implementation of the WHATWG URL Standard's URL API and parsing machinery
homepage:
license: mit
licenses:
- sources: LICENSE.txt
text: |
The MIT License (MIT)
Copyright (c) 20152016 Sebastian Mayr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
notices: []

View File

@@ -88,16 +88,19 @@ frontend:
Create a workflow (eg: `.github/workflows/labeler.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the labeler action with content:
```
```yml
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
```
@@ -110,7 +113,7 @@ Various inputs are defined in [`action.yml`](action.yml) to let you configure th
| Name | Description | Default |
| - | - | - |
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret | N/A |
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | N/A |
| `configuration-path` | The path to the label configuration file | `.github/labeler.yml` |
| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false`

View File

@@ -14,5 +14,5 @@ inputs:
required: false
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

2669
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "labeler",
"version": "3.0.2",
"version": "3.1.0",
"description": "Labels pull requests by files altered",
"main": "lib/main.js",
"scripts": {
@@ -22,20 +22,20 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.4.0",
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0",
"js-yaml": "^4.1.0",
"minimatch": "^3.0.4"
},
"devDependencies": {
"@types/jest": "^26.0.24",
"@types/node": "^16.4.11",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.7",
"@types/minimatch": "^3.0.5",
"@types/js-yaml": "^4.0.2",
"@vercel/ncc": "^0.29.0",
"jest": "^27.0.6",
"prettier": "^2.3.2",
"ts-jest": "^27.0.4",
"typescript": "^4.3.5"
"@types/js-yaml": "^4.0.5",
"@vercel/ncc": "^0.33.3",
"jest": "^27.5.1",
"prettier": "^2.6.2",
"ts-jest": "^27.1.3",
"typescript": "^4.6.3"
}
}

View File

@@ -57,7 +57,7 @@ export async function run() {
if (syncLabels && labelsToRemove.length) {
await removeLabels(client, prNumber, labelsToRemove);
}
} catch (error) {
} catch (error: any) {
core.error(error);
core.setFailed(error.message);
}