mirror of
https://github.com/actions/labeler.git
synced 2025-12-11 20:24:51 +00:00
Compare commits
98 Commits
update-cod
...
v4.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fcb2c2f55 | ||
|
|
0d06c50435 | ||
|
|
1d399c3ab6 | ||
|
|
82a4f6fc25 | ||
|
|
d40596e5db | ||
|
|
3cbc54c641 | ||
|
|
639ba81ab1 | ||
|
|
71d2484daa | ||
|
|
59d3310a72 | ||
|
|
a78a6c7eb7 | ||
|
|
54d434dac5 | ||
|
|
d07f38b87f | ||
|
|
e3b3815c8d | ||
|
|
673c7e22a7 | ||
|
|
44414dbc7d | ||
|
|
a27020c135 | ||
|
|
97762039fe | ||
|
|
60f44e7cf1 | ||
|
|
092c979868 | ||
|
|
cecbd94bd4 | ||
|
|
7fef7e3d17 | ||
|
|
0776a67936 | ||
|
|
2713f7303c | ||
|
|
a4eda65d3d | ||
|
|
5c4deb8a24 | ||
|
|
08382d15cb | ||
|
|
61662e8f41 | ||
|
|
d1dd326ccc | ||
|
|
91076827ed | ||
|
|
012b89238e | ||
|
|
6b107e7a7e | ||
|
|
d93c73a681 | ||
|
|
b6f708799c | ||
|
|
2d89bd5059 | ||
|
|
581d1100aa | ||
|
|
8bb4872750 | ||
|
|
9c4ae1e112 | ||
|
|
228fdad71d | ||
|
|
377691d3d6 | ||
|
|
9471598e3b | ||
|
|
b0e65268f8 | ||
|
|
757daa4b3c | ||
|
|
d8f73a2893 | ||
|
|
3c1531c7aa | ||
|
|
2fad4e29df | ||
|
|
656fcaf1a6 | ||
|
|
649bbe91ec | ||
|
|
dc4d5ad22c | ||
|
|
b5e92d4c4b | ||
|
|
4c60b58719 | ||
|
|
a7cc8a62ef | ||
|
|
b28379f6ed | ||
|
|
b898cc8e29 | ||
|
|
30f43a6adc | ||
|
|
7012d51fe0 | ||
|
|
9edd2bf941 | ||
|
|
ebf4aac003 | ||
|
|
751921c443 | ||
|
|
468a5e0250 | ||
|
|
1ed0c2c7a6 | ||
|
|
72bf170dc0 | ||
|
|
e761520c9d | ||
|
|
5ecb1a5c3f | ||
|
|
edfedeeea2 | ||
|
|
bf8c2560d4 | ||
|
|
113f4f535c | ||
|
|
e22b544e48 | ||
|
|
ca88756804 | ||
|
|
2a81921fe4 | ||
|
|
4a96e771de | ||
|
|
59036c7b95 | ||
|
|
a589a5f6e6 | ||
|
|
8d81f881dd | ||
|
|
ba790c862c | ||
|
|
b3338513be | ||
|
|
7500838c8c | ||
|
|
46f10bd82e | ||
|
|
cfabdea1fa | ||
|
|
826c4e60e2 | ||
|
|
8e3e86e548 | ||
|
|
d4bda4db14 | ||
|
|
305cfeb74c | ||
|
|
866eff55a5 | ||
|
|
b435530b77 | ||
|
|
36adcc2cb2 | ||
|
|
4878a7e749 | ||
|
|
a11f1c4163 | ||
|
|
9080674cf7 | ||
|
|
b78dba3eb5 | ||
|
|
20251547f9 | ||
|
|
d89797c51d | ||
|
|
f3632d3e9f | ||
|
|
e05b7c1927 | ||
|
|
8b8677b4ce | ||
|
|
920e9b6169 | ||
|
|
409a5a2095 | ||
|
|
6a0b7265cb | ||
|
|
b0d9292064 |
7
.eslintignore
Normal file
7
.eslintignore
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!__mocks__/
|
||||||
|
!src/
|
||||||
51
.eslintrc.js
Normal file
51
.eslintrc.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||||
|
module.exports = {
|
||||||
|
extends: [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:eslint-plugin-jest/recommended',
|
||||||
|
'eslint-config-prettier'
|
||||||
|
],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-require-imports': 'error',
|
||||||
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-empty-function': 'off',
|
||||||
|
'@typescript-eslint/ban-ts-comment': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'ts-ignore': 'allow-with-description'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-console': 'error',
|
||||||
|
'yoda': 'error',
|
||||||
|
'prefer-const': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
destructuring: 'all'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'no-control-regex': 'off',
|
||||||
|
'no-constant-condition': ['error', {checkLoops: false}],
|
||||||
|
'node/no-extraneous-import': 'error'
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['**/*{test,spec}.ts'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'jest/no-standalone-expect': 'off',
|
||||||
|
'jest/no-conditional-expect': 'off',
|
||||||
|
'no-console': 'off',
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
es6: true,
|
||||||
|
'jest/globals': true
|
||||||
|
}
|
||||||
|
};
|
||||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,4 +1,4 @@
|
|||||||
* text=auto
|
* text=auto eol=lf
|
||||||
.licenses/** -diff linguist-generated=true
|
.licenses/** -diff linguist-generated=true
|
||||||
|
|
||||||
# don't diff machine generated files
|
# don't diff machine generated files
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
uses: actions/publish-action@v0.2.1
|
uses: actions/publish-action@v0.2.2
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|||||||
11
.github/workflows/update-config-files.yml
vendored
Normal file
11
.github/workflows/update-config-files.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
name: Update configuration files
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 3 * * 0'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-update-configuration-files:
|
||||||
|
name: Update configuration files
|
||||||
|
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
||||||
2
.licenses/npm/@actions/github.dep.yml
generated
2
.licenses/npm/@actions/github.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/github"
|
name: "@actions/github"
|
||||||
version: 5.0.0
|
version: 5.1.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions github lib
|
summary: Actions github lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/github
|
homepage: https://github.com/actions/toolkit/tree/main/packages/github
|
||||||
|
|||||||
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
32
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@actions/http-client"
|
|
||||||
version: 1.0.11
|
|
||||||
type: npm
|
|
||||||
summary: Actions Http Client
|
|
||||||
homepage: https://github.com/actions/http-client#readme
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
Actions Http Client for Node.js
|
|
||||||
|
|
||||||
Copyright (c) GitHub, Inc.
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
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: []
|
|
||||||
4
.licenses/npm/@octokit/auth-token.dep.yml
generated
4
.licenses/npm/@octokit/auth-token.dep.yml
generated
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/auth-token"
|
name: "@octokit/auth-token"
|
||||||
version: 2.4.5
|
version: 2.5.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: GitHub API token authentication for browsers and Node.js
|
summary: GitHub API token authentication for browsers and Node.js
|
||||||
homepage: https://github.com/octokit/auth-token.js#readme
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
2
.licenses/npm/@octokit/core.dep.yml
generated
2
.licenses/npm/@octokit/core.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/core"
|
name: "@octokit/core"
|
||||||
version: 3.5.1
|
version: 3.6.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Extendable client for GitHub's REST & GraphQL APIs
|
summary: Extendable client for GitHub's REST & GraphQL APIs
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
2
.licenses/npm/@octokit/graphql.dep.yml
generated
2
.licenses/npm/@octokit/graphql.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/graphql"
|
name: "@octokit/graphql"
|
||||||
version: 4.6.4
|
version: 4.8.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: GitHub GraphQL API client for browsers and Node
|
summary: GitHub GraphQL API client for browsers and Node
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
4
.licenses/npm/@octokit/openapi-types.dep.yml
generated
4
.licenses/npm/@octokit/openapi-types.dep.yml
generated
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/openapi-types"
|
name: "@octokit/openapi-types"
|
||||||
version: 7.3.2
|
version: 12.11.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec
|
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
|
||||||
homepage:
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/plugin-paginate-rest"
|
name: "@octokit/plugin-paginate-rest"
|
||||||
version: 2.13.5
|
version: 2.21.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: Octokit plugin to paginate REST API endpoint responses
|
summary: Octokit plugin to paginate REST API endpoint responses
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/plugin-rest-endpoint-methods"
|
name: "@octokit/plugin-rest-endpoint-methods"
|
||||||
version: 5.3.1
|
version: 5.16.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
|
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
6
.licenses/npm/@octokit/request.dep.yml
generated
6
.licenses/npm/@octokit/request.dep.yml
generated
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/request"
|
name: "@octokit/request"
|
||||||
version: 5.6.0
|
version: 5.6.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: "Send parameterized requests to GitHubâ\x80\x99s APIs with sensible defaults
|
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
|
||||||
in browsers and Node"
|
and Node
|
||||||
homepage:
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
|
|||||||
2
.licenses/npm/@octokit/types.dep.yml
generated
2
.licenses/npm/@octokit/types.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@octokit/types"
|
name: "@octokit/types"
|
||||||
version: 6.16.4
|
version: 6.41.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Shared TypeScript definitions for Octokit projects
|
summary: Shared TypeScript definitions for Octokit projects
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
2
.licenses/npm/balanced-match.dep.yml
generated
2
.licenses/npm/balanced-match.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: balanced-match
|
name: balanced-match
|
||||||
version: 1.0.0
|
version: 1.0.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: Match balanced character pairs, like "{" and "}"
|
summary: Match balanced character pairs, like "{" and "}"
|
||||||
homepage: https://github.com/juliangruber/balanced-match
|
homepage: https://github.com/juliangruber/balanced-match
|
||||||
|
|||||||
2
.licenses/npm/before-after-hook.dep.yml
generated
2
.licenses/npm/before-after-hook.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: before-after-hook
|
name: before-after-hook
|
||||||
version: 2.2.2
|
version: 2.2.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: asynchronous before/error/after hooks for internal functionality
|
summary: asynchronous before/error/after hooks for internal functionality
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
2
.licenses/npm/brace-expansion.dep.yml
generated
2
.licenses/npm/brace-expansion.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: brace-expansion
|
name: brace-expansion
|
||||||
version: 1.1.11
|
version: 2.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Brace expansion as known from sh/bash
|
summary: Brace expansion as known from sh/bash
|
||||||
homepage: https://github.com/juliangruber/brace-expansion
|
homepage: https://github.com/juliangruber/brace-expansion
|
||||||
|
|||||||
31
.licenses/npm/concat-map.dep.yml
generated
31
.licenses/npm/concat-map.dep.yml
generated
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
name: concat-map
|
|
||||||
version: 0.0.1
|
|
||||||
type: npm
|
|
||||||
summary: concatenative mapdashery
|
|
||||||
homepage:
|
|
||||||
license: other
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
This software is released under the 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.
|
|
||||||
- sources: README.markdown
|
|
||||||
text: MIT
|
|
||||||
notices: []
|
|
||||||
4
.licenses/npm/minimatch.dep.yml
generated
4
.licenses/npm/minimatch.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: minimatch
|
name: minimatch
|
||||||
version: 3.1.2
|
version: 7.4.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: a glob matcher in javascript
|
summary: a glob matcher in javascript
|
||||||
homepage:
|
homepage:
|
||||||
@@ -10,7 +10,7 @@ licenses:
|
|||||||
text: |
|
text: |
|
||||||
The ISC License
|
The ISC License
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|||||||
8
.prettierignore
Normal file
8
.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Ignore list
|
||||||
|
/*
|
||||||
|
|
||||||
|
# Do not ignore these folders:
|
||||||
|
!__tests__/
|
||||||
|
!__mocks__/
|
||||||
|
!.github/
|
||||||
|
!src/
|
||||||
11
.prettierrc.js
Normal file
11
.prettierrc.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||||
|
module.exports = {
|
||||||
|
printWidth: 80,
|
||||||
|
tabWidth: 2,
|
||||||
|
useTabs: false,
|
||||||
|
semi: true,
|
||||||
|
singleQuote: true,
|
||||||
|
trailingComma: 'none',
|
||||||
|
bracketSpacing: false,
|
||||||
|
arrowParens: 'avoid'
|
||||||
|
};
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 80,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": false,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "none",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"parser": "typescript",
|
|
||||||
"endOfLine": "auto"
|
|
||||||
}
|
|
||||||
49
README.md
49
README.md
@@ -1,13 +1,6 @@
|
|||||||
# Pull Request Labeler
|
# Pull Request Labeler
|
||||||
|
|
||||||
<p align="left">
|
[](https://github.com/actions/labeler/actions/workflows/basic-validation.yml)
|
||||||
<a href="https://github.com/actions/labeler/actions?query=workflow%3A%22Build+%26+Test%22++">
|
|
||||||
<img alt="build and test status" src="https://github.com/actions/labeler/actions/workflows/build_test.yml/badge.svg">
|
|
||||||
</a>
|
|
||||||
<a href="https://david-dm.org/actions/labeler">
|
|
||||||
<img alt="dependencies" src="https://status.david-dm.org/gh/actions/labeler.svg">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Automatically label new pull requests based on the paths of files being changed.
|
Automatically label new pull requests based on the paths of files being changed.
|
||||||
|
|
||||||
@@ -17,7 +10,7 @@ Automatically label new pull requests based on the paths of files being changed.
|
|||||||
|
|
||||||
Create a `.github/labeler.yml` file with a list of labels and [minimatch](https://github.com/isaacs/minimatch) globs to match to apply the label.
|
Create a `.github/labeler.yml` file with a list of labels and [minimatch](https://github.com/isaacs/minimatch) globs to match to apply the label.
|
||||||
|
|
||||||
The key is the name of the label in your repository that you want to add (eg: "merge conflict", "needs-updating") and the value is the path (glob) of the changed files (eg: `src/**/*`, `tests/*.spec.js`) or a match object.
|
The key is the name of the label in your repository that you want to add (eg: "merge conflict", "needs-updating") and the value is the path (glob) of the changed files (eg: `src/**`, `tests/*.spec.js`) or a match object.
|
||||||
|
|
||||||
#### Match Object
|
#### Match Object
|
||||||
|
|
||||||
@@ -47,12 +40,17 @@ label1:
|
|||||||
|
|
||||||
From a boolean logic perspective, top-level match objects are `OR`-ed together and individual match rules within an object are `AND`-ed. Combined with `!` negation, you can write complex matching rules.
|
From a boolean logic perspective, top-level match objects are `OR`-ed together and individual match rules within an object are `AND`-ed. Combined with `!` negation, you can write complex matching rules.
|
||||||
|
|
||||||
|
> ⚠️ This action uses [minimatch](https://www.npmjs.com/package/minimatch) to apply glob patterns.
|
||||||
|
> For historical reasons, paths starting with dot (e.g. `.github`) are not matched by default.
|
||||||
|
> You need to set `dot: true` to change this behavior.
|
||||||
|
> See [Inputs](#inputs) table below for details.
|
||||||
|
|
||||||
#### Basic Examples
|
#### Basic Examples
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
# Add 'label1' to any changes within 'example' folder or any subfolders
|
# Add 'label1' to any changes within 'example' folder or any subfolders
|
||||||
label1:
|
label1:
|
||||||
- example/**/*
|
- example/**
|
||||||
|
|
||||||
# Add 'label2' to any file changes within 'example2' folder
|
# Add 'label2' to any file changes within 'example2' folder
|
||||||
label2: example2/*
|
label2: example2/*
|
||||||
@@ -72,8 +70,7 @@ repo:
|
|||||||
|
|
||||||
# Add '@domain/core' label to any change within the 'core' package
|
# Add '@domain/core' label to any change within the 'core' package
|
||||||
'@domain/core':
|
'@domain/core':
|
||||||
- package/core/*
|
- package/core/**
|
||||||
- package/core/**/*
|
|
||||||
|
|
||||||
# Add 'test' label to any change to *.spec.js files within the source dir
|
# Add 'test' label to any change to *.spec.js files within the source dir
|
||||||
test:
|
test:
|
||||||
@@ -81,7 +78,7 @@ test:
|
|||||||
|
|
||||||
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
|
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
|
||||||
source:
|
source:
|
||||||
- any: ['src/**/*', '!src/docs/*']
|
- any: ['src/**', '!src/docs/*']
|
||||||
|
|
||||||
# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed
|
# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed
|
||||||
frontend:
|
frontend:
|
||||||
@@ -106,22 +103,34 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v4
|
- uses: actions/labeler@v4
|
||||||
with:
|
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
_Note: This grants access to the `GITHUB_TOKEN` so the action can make calls to GitHub's rest API_
|
|
||||||
|
|
||||||
#### Inputs
|
#### Inputs
|
||||||
|
|
||||||
Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler:
|
Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler:
|
||||||
|
|
||||||
| Name | Description | Default |
|
| Name | Description | Default |
|
||||||
| - | - | - |
|
| - | - | - |
|
||||||
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | N/A |
|
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | `github.token` |
|
||||||
| `configuration-path` | The path to the label configuration file | `.github/labeler.yml` |
|
| `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`
|
| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false` |
|
||||||
|
| `dot` | Whether or not to auto-include paths starting with dot (e.g. `.github`) | `false` |
|
||||||
|
|
||||||
# Contributions
|
When `dot` is disabled and you want to include _all_ files in a folder:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
label1:
|
||||||
|
- path/to/folder/**/*
|
||||||
|
- path/to/folder/**/.*
|
||||||
|
```
|
||||||
|
|
||||||
|
If `dot` is enabled:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
label1:
|
||||||
|
- path/to/folder/**
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributions
|
||||||
|
|
||||||
Contributions are welcome! See the [Contributor's Guide](CONTRIBUTING.md).
|
Contributions are welcome! See the [Contributor's Guide](CONTRIBUTING.md).
|
||||||
|
|||||||
@@ -15,15 +15,29 @@ const matchConfig = [{any: ['*.txt']}];
|
|||||||
describe('checkGlobs', () => {
|
describe('checkGlobs', () => {
|
||||||
it('returns true when our pattern does match changed files', () => {
|
it('returns true when our pattern does match changed files', () => {
|
||||||
const changedFiles = ['foo.txt', 'bar.txt'];
|
const changedFiles = ['foo.txt', 'bar.txt'];
|
||||||
const result = checkGlobs(changedFiles, matchConfig);
|
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||||
|
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when our pattern does not match changed files', () => {
|
it('returns false when our pattern does not match changed files', () => {
|
||||||
const changedFiles = ['foo.docx'];
|
const changedFiles = ['foo.docx'];
|
||||||
const result = checkGlobs(changedFiles, matchConfig);
|
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||||
|
|
||||||
expect(result).toBeFalsy();
|
expect(result).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('returns false for a file starting with dot if `dot` option is false', () => {
|
||||||
|
const changedFiles = ['.foo.txt'];
|
||||||
|
const result = checkGlobs(changedFiles, matchConfig, false);
|
||||||
|
|
||||||
|
expect(result).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns true for a file starting with dot if `dot` option is true', () => {
|
||||||
|
const changedFiles = ['.foo.txt'];
|
||||||
|
const result = checkGlobs(changedFiles, matchConfig, true);
|
||||||
|
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,10 +18,27 @@ const yamlFixtures = {
|
|||||||
'only_pdfs.yml': fs.readFileSync('__tests__/fixtures/only_pdfs.yml')
|
'only_pdfs.yml': fs.readFileSync('__tests__/fixtures/only_pdfs.yml')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const configureInput = (
|
||||||
|
mockInput: Partial<{
|
||||||
|
'repo-token': string;
|
||||||
|
'configuration-path': string;
|
||||||
|
'sync-labels': boolean;
|
||||||
|
dot: boolean;
|
||||||
|
}>
|
||||||
|
) => {
|
||||||
|
jest
|
||||||
|
.spyOn(core, 'getInput')
|
||||||
|
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
||||||
|
jest
|
||||||
|
.spyOn(core, 'getBooleanInput')
|
||||||
|
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
||||||
|
};
|
||||||
|
|
||||||
afterAll(() => jest.restoreAllMocks());
|
afterAll(() => jest.restoreAllMocks());
|
||||||
|
|
||||||
describe('run', () => {
|
describe('run', () => {
|
||||||
it('adds labels to PRs that match our glob patterns', async () => {
|
it('(with dot: false) adds labels to PRs that match our glob patterns', async () => {
|
||||||
|
configureInput({});
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.pdf');
|
mockGitHubResponseChangedFiles('foo.pdf');
|
||||||
|
|
||||||
@@ -37,7 +54,36 @@ describe('run', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not add labels to PRs that do not match our glob patterns', async () => {
|
it('(with dot: true) adds labels to PRs that match our glob patterns', async () => {
|
||||||
|
configureInput({dot: true});
|
||||||
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
|
mockGitHubResponseChangedFiles('.foo.pdf');
|
||||||
|
|
||||||
|
await run();
|
||||||
|
|
||||||
|
expect(removeLabelMock).toHaveBeenCalledTimes(0);
|
||||||
|
expect(addLabelsMock).toHaveBeenCalledTimes(1);
|
||||||
|
expect(addLabelsMock).toHaveBeenCalledWith({
|
||||||
|
owner: 'monalisa',
|
||||||
|
repo: 'helloworld',
|
||||||
|
issue_number: 123,
|
||||||
|
labels: ['touched-a-pdf-file']
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('(with dot: false) does not add labels to PRs that do not match our glob patterns', async () => {
|
||||||
|
configureInput({});
|
||||||
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
|
mockGitHubResponseChangedFiles('.foo.pdf');
|
||||||
|
|
||||||
|
await run();
|
||||||
|
|
||||||
|
expect(removeLabelMock).toHaveBeenCalledTimes(0);
|
||||||
|
expect(addLabelsMock).toHaveBeenCalledTimes(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('(with dot: true) does not add labels to PRs that do not match our glob patterns', async () => {
|
||||||
|
configureInput({dot: true});
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.txt');
|
mockGitHubResponseChangedFiles('foo.txt');
|
||||||
|
|
||||||
@@ -48,15 +94,11 @@ describe('run', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('(with sync-labels: true) it deletes preexisting PR labels that no longer match the glob pattern', async () => {
|
it('(with sync-labels: true) it deletes preexisting PR labels that no longer match the glob pattern', async () => {
|
||||||
let mockInput = {
|
configureInput({
|
||||||
'repo-token': 'foo',
|
'repo-token': 'foo',
|
||||||
'configuration-path': 'bar',
|
'configuration-path': 'bar',
|
||||||
'sync-labels': true
|
'sync-labels': true
|
||||||
};
|
});
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(core, 'getInput')
|
|
||||||
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
|
||||||
|
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.txt');
|
mockGitHubResponseChangedFiles('foo.txt');
|
||||||
@@ -79,15 +121,11 @@ describe('run', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('(with sync-labels: false) it issues no delete calls even when there are preexisting PR labels that no longer match the glob pattern', async () => {
|
it('(with sync-labels: false) it issues no delete calls even when there are preexisting PR labels that no longer match the glob pattern', async () => {
|
||||||
let mockInput = {
|
configureInput({
|
||||||
'repo-token': 'foo',
|
'repo-token': 'foo',
|
||||||
'configuration-path': 'bar',
|
'configuration-path': 'bar',
|
||||||
'sync-labels': false
|
'sync-labels': false
|
||||||
};
|
});
|
||||||
|
|
||||||
jest
|
|
||||||
.spyOn(core, 'getInput')
|
|
||||||
.mockImplementation((name: string, ...opts) => mockInput[name]);
|
|
||||||
|
|
||||||
usingLabelerConfigYaml('only_pdfs.yml');
|
usingLabelerConfigYaml('only_pdfs.yml');
|
||||||
mockGitHubResponseChangedFiles('foo.txt');
|
mockGitHubResponseChangedFiles('foo.txt');
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ description: 'Automatically label new pull requests based on the paths of files
|
|||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
repo-token:
|
repo-token:
|
||||||
description: 'The GITHUB_TOKEN secret'
|
description: 'The GitHub token used to manage labels'
|
||||||
|
required: false
|
||||||
|
default: ${{ github.token }}
|
||||||
configuration-path:
|
configuration-path:
|
||||||
description: 'The path for the label configurations'
|
description: 'The path for the label configurations'
|
||||||
default: '.github/labeler.yml'
|
default: '.github/labeler.yml'
|
||||||
@@ -12,6 +14,10 @@ inputs:
|
|||||||
description: 'Whether or not to remove labels when matching files are reverted'
|
description: 'Whether or not to remove labels when matching files are reverted'
|
||||||
default: false
|
default: false
|
||||||
required: false
|
required: false
|
||||||
|
dot:
|
||||||
|
description: 'Whether or not to auto-include paths starting with dot (e.g. `.github`)'
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
|
|||||||
4517
dist/index.js
vendored
4517
dist/index.js
vendored
File diff suppressed because one or more lines are too long
4514
package-lock.json
generated
4514
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@@ -5,9 +5,10 @@
|
|||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && ncc build lib/main.js",
|
"build": "tsc && ncc build lib/main.js",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
|
||||||
"lint": "echo \"Fake command that does nothing. It is used in reusable workflows\"",
|
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
||||||
|
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -24,19 +25,25 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.1.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^7.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.4.1",
|
"@types/jest": "^27.4.1",
|
||||||
"@types/node": "^16.11.7",
|
|
||||||
"@types/minimatch": "^3.0.5",
|
|
||||||
"@types/js-yaml": "^4.0.5",
|
"@types/js-yaml": "^4.0.5",
|
||||||
"@vercel/ncc": "^0.34.0",
|
"@types/minimatch": "^5.1.2",
|
||||||
|
"@types/node": "^16.11.7",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
||||||
|
"@typescript-eslint/parser": "^5.59.8",
|
||||||
|
"@vercel/ncc": "^0.36.1",
|
||||||
|
"eslint": "^8.41.0",
|
||||||
|
"eslint-config-prettier": "^8.8.0",
|
||||||
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"jest": "^27.5.1",
|
"jest": "^27.5.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.8",
|
||||||
"ts-jest": "^27.1.3",
|
"ts-jest": "^27.1.3",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^4.9.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
import * as yaml from 'js-yaml';
|
import * as yaml from 'js-yaml';
|
||||||
import {Minimatch, IMinimatch} from 'minimatch';
|
import {Minimatch} from 'minimatch';
|
||||||
|
|
||||||
interface MatchConfig {
|
interface MatchConfig {
|
||||||
all?: string[];
|
all?: string[];
|
||||||
@@ -13,13 +13,14 @@ type ClientType = ReturnType<typeof github.getOctokit>;
|
|||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token', {required: true});
|
const token = core.getInput('repo-token');
|
||||||
const configPath = core.getInput('configuration-path', {required: true});
|
const configPath = core.getInput('configuration-path', {required: true});
|
||||||
const syncLabels = !!core.getInput('sync-labels', {required: false});
|
const syncLabels = !!core.getInput('sync-labels');
|
||||||
|
const dot = core.getBooleanInput('dot');
|
||||||
|
|
||||||
const prNumber = getPrNumber();
|
const prNumber = getPrNumber();
|
||||||
if (!prNumber) {
|
if (!prNumber) {
|
||||||
console.log('Could not get pull request number from context, exiting');
|
core.info('Could not get pull request number from context, exiting');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ export async function run() {
|
|||||||
const labelsToRemove: string[] = [];
|
const labelsToRemove: string[] = [];
|
||||||
for (const [label, globs] of labelGlobs.entries()) {
|
for (const [label, globs] of labelGlobs.entries()) {
|
||||||
core.debug(`processing ${label}`);
|
core.debug(`processing ${label}`);
|
||||||
if (checkGlobs(changedFiles, globs)) {
|
if (checkGlobs(changedFiles, globs, dot)) {
|
||||||
labels.push(label);
|
labels.push(label);
|
||||||
} else if (pullRequest.labels.find(l => l.name === label)) {
|
} else if (pullRequest.labels.find(l => l.name === label)) {
|
||||||
labelsToRemove.push(label);
|
labelsToRemove.push(label);
|
||||||
@@ -151,25 +152,26 @@ function toMatchConfig(config: StringOrMatchConfig): MatchConfig {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
function printPattern(matcher: IMinimatch): string {
|
function printPattern(matcher: Minimatch): string {
|
||||||
return (matcher.negate ? '!' : '') + matcher.pattern;
|
return (matcher.negate ? '!' : '') + matcher.pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkGlobs(
|
export function checkGlobs(
|
||||||
changedFiles: string[],
|
changedFiles: string[],
|
||||||
globs: StringOrMatchConfig[]
|
globs: StringOrMatchConfig[],
|
||||||
|
dot: boolean
|
||||||
): boolean {
|
): boolean {
|
||||||
for (const glob of globs) {
|
for (const glob of globs) {
|
||||||
core.debug(` checking pattern ${JSON.stringify(glob)}`);
|
core.debug(` checking pattern ${JSON.stringify(glob)}`);
|
||||||
const matchConfig = toMatchConfig(glob);
|
const matchConfig = toMatchConfig(glob);
|
||||||
if (checkMatch(changedFiles, matchConfig)) {
|
if (checkMatch(changedFiles, matchConfig, dot)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMatch(changedFile: string, matchers: IMinimatch[]): boolean {
|
function isMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
||||||
core.debug(` matching patterns against file ${changedFile}`);
|
core.debug(` matching patterns against file ${changedFile}`);
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
core.debug(` - ${printPattern(matcher)}`);
|
core.debug(` - ${printPattern(matcher)}`);
|
||||||
@@ -184,8 +186,12 @@ function isMatch(changedFile: string, matchers: IMinimatch[]): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// equivalent to "Array.some()" but expanded for debugging and clarity
|
// equivalent to "Array.some()" but expanded for debugging and clarity
|
||||||
function checkAny(changedFiles: string[], globs: string[]): boolean {
|
function checkAny(
|
||||||
const matchers = globs.map(g => new Minimatch(g));
|
changedFiles: string[],
|
||||||
|
globs: string[],
|
||||||
|
dot: boolean
|
||||||
|
): boolean {
|
||||||
|
const matchers = globs.map(g => new Minimatch(g, {dot}));
|
||||||
core.debug(` checking "any" patterns`);
|
core.debug(` checking "any" patterns`);
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (isMatch(changedFile, matchers)) {
|
if (isMatch(changedFile, matchers)) {
|
||||||
@@ -199,8 +205,12 @@ function checkAny(changedFiles: string[], globs: string[]): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// equivalent to "Array.every()" but expanded for debugging and clarity
|
// equivalent to "Array.every()" but expanded for debugging and clarity
|
||||||
function checkAll(changedFiles: string[], globs: string[]): boolean {
|
function checkAll(
|
||||||
const matchers = globs.map(g => new Minimatch(g));
|
changedFiles: string[],
|
||||||
|
globs: string[],
|
||||||
|
dot: boolean
|
||||||
|
): boolean {
|
||||||
|
const matchers = globs.map(g => new Minimatch(g, {dot}));
|
||||||
core.debug(` checking "all" patterns`);
|
core.debug(` checking "all" patterns`);
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (!isMatch(changedFile, matchers)) {
|
if (!isMatch(changedFile, matchers)) {
|
||||||
@@ -213,15 +223,19 @@ function checkAll(changedFiles: string[], globs: string[]): boolean {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkMatch(changedFiles: string[], matchConfig: MatchConfig): boolean {
|
function checkMatch(
|
||||||
|
changedFiles: string[],
|
||||||
|
matchConfig: MatchConfig,
|
||||||
|
dot: boolean
|
||||||
|
): boolean {
|
||||||
if (matchConfig.all !== undefined) {
|
if (matchConfig.all !== undefined) {
|
||||||
if (!checkAll(changedFiles, matchConfig.all)) {
|
if (!checkAll(changedFiles, matchConfig.all, dot)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchConfig.any !== undefined) {
|
if (matchConfig.any !== undefined) {
|
||||||
if (!checkAny(changedFiles, matchConfig.any)) {
|
if (!checkAny(changedFiles, matchConfig.any, dot)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user