Skip to content

Commit

Permalink
Update to labeler v2 (actions#4)
Browse files Browse the repository at this point in the history
* labeler v2

* update docs
  • Loading branch information
shawnnapora authored and Danny McCormick committed Aug 8, 2019
1 parent ab3b5b5 commit 7d083c4
Show file tree
Hide file tree
Showing 21 changed files with 5,873 additions and 2,074 deletions.
14 changes: 0 additions & 14 deletions .github/main.workflow

This file was deleted.

76 changes: 0 additions & 76 deletions CODE_OF_CONDUCT.md

This file was deleted.

33 changes: 0 additions & 33 deletions CONTRIBUTING.md

This file was deleted.

20 changes: 0 additions & 20 deletions Dockerfile

This file was deleted.

13 changes: 7 additions & 6 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2019 GitHub
The MIT License (MIT)

Copyright (c) 2018 GitHub, Inc. and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +10,13 @@ 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 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.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
68 changes: 25 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,32 @@
# Pull Request Labeller
# Pull Request Labeler

This action labels pull requests by comparing their changed files to a configuration file in the repository.
Pull request labeler triages PRs based on the paths that are modified in the PR.

For example, a configuration file at `.github/triage.yml` may look like this:
To use, 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.

```yaml
design:
- src/frontend/**/*.css
- src/frontend/**/*.png

server:
- src/server/**/*
Example:
```
label1:
- example1/**/*
And the action would be used like this:
```workflow
workflow "Apply PR labels" {
on = "pull_request"
resolves = "Apply labels"
}

action "On sync" {
uses = "actions/bin/filter@master"
args = "action synchronize"
}
label2: example2/*
action "Apply labels" {
uses = "actions/[email protected]"
needs = "On sync"
env = {LABEL_SPEC_FILE=".github/triage.yml"}
secrets = ["GITHUB_TOKEN"]
}
label3:
- example3/*
- example3/**/*.yml
```
Then create a workflow:
```
name: "Pull Request Labeler"
on:
- pull-request
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
```

Now, whenever a user pushes to a pull request, this action will determine whether any changed files in that pull request match the specification file (note: this action uses [minimatch](https://github.com/isaacs/minimatch) to determine matches). If there are matches, the action will apply the appropriate labels to the pull request.

## Contributing

Check out [this doc](CONTRIBUTING.md).

## License

This action is released under the [MIT license](LICENSE.md).
Container images built with this project include third party materials. See [THIRD_PARTY_NOTICE.md](THIRD_PARTY_NOTICE.md) for details.

## Current Status

This action is in active development.
Loading

0 comments on commit 7d083c4

Please sign in to comment.