-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement dot option #316
Merged
Merged
Implement dot option #316
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
b0d9292
Implement dot option
kachkaev 6a0b726
Rebuild
kachkaev 409a5a2
Fix typo in test caption
kachkaev 920e9b6
Add comments
kachkaev 8b8677b
Improve warning
kachkaev e05b7c1
Update README.md
kachkaev f3632d3
Update README.md
kachkaev d89797c
Merge remote-tracking branch 'upstream/main' into dot-option
kachkaev 2025154
Simplify glob
kachkaev 866eff5
Merge remote-tracking branch 'origin/main' into dot-option
kachkaev 305cfeb
Rebuild
kachkaev 4a96e77
Merge branch 'main' into dot-option
kachkaev b898cc8
Merge remote-tracking branch 'u/main' into dot-option
kachkaev b28379f
Cleanup
kachkaev a7cc8a6
Fix
kachkaev 012b892
Merge remote-tracking branch 'u/main' into dot-option
kachkaev cecbd94
Merge remote-tracking branch 'u/main' into dot-option
kachkaev 092c979
Update src/labeler.ts
kachkaev 60f44e7
Fix unrelated test
kachkaev 9776203
Update build
kachkaev a27020c
Undo unwanted change in diff
kachkaev 44414db
Fix tests
kachkaev 673c7e2
Rebuild
kachkaev e3b3815
Further diff reduction
kachkaev 54d434d
Remove `required: false`
kachkaev 59d3310
Rebuild
kachkaev 71d2484
Address review comment
kachkaev 639ba81
Rebuild
kachkaev d40596e
micromatch → minimatch
kachkaev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,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. | ||
|
||
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 | ||
|
||
|
@@ -40,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. | ||
|
||
> ⚠️ 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 | ||
|
||
```yml | ||
# Add 'label1' to any changes within 'example' folder or any subfolders | ||
label1: | ||
- example/**/* | ||
- example/** | ||
|
||
# Add 'label2' to any file changes within 'example2' folder | ||
label2: example2/* | ||
|
@@ -65,16 +70,15 @@ repo: | |
|
||
# Add '@domain/core' label to any change within the 'core' package | ||
'@domain/core': | ||
- package/core/* | ||
kachkaev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- package/core/**/* | ||
- package/core/** | ||
|
||
# Add 'test' label to any change to *.spec.js files within the source dir | ||
test: | ||
- src/**/*.spec.js | ||
|
||
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder | ||
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 | ||
frontend: | ||
|
@@ -109,8 +113,24 @@ Various inputs are defined in [`action.yml`](action.yml) to let you configure th | |
| - | - | - | | ||
| `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` | | ||
| `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` | | ||
|
||
When `dot` is disabled and you want to include _all_ files in a folder: | ||
|
||
```yml | ||
label1: | ||
- path/to/folder/**/* | ||
- path/to/folder/**/.* | ||
Comment on lines
+123
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about |
||
``` | ||
|
||
If `dot` is enabled: | ||
|
||
```yml | ||
label1: | ||
- path/to/folder/** | ||
``` | ||
|
||
# Contributions | ||
## Contributions | ||
|
||
Contributions are welcome! See the [Contributor's Guide](CONTRIBUTING.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref: DataDog/dd-trace-rb#2291 (comment)