https://github.com/kaelaela/danger-auto_label
Enable to set label automatically from Danger. This is made from Danger plugin.
https://github.com/kaelaela/danger-auto_label
danger danger-plugin ruby
Last synced: 5 months ago
JSON representation
Enable to set label automatically from Danger. This is made from Danger plugin.
- Host: GitHub
- URL: https://github.com/kaelaela/danger-auto_label
- Owner: kaelaela
- License: mit
- Created: 2017-10-13T15:42:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T03:28:30.000Z (over 2 years ago)
- Last Synced: 2025-04-17T09:52:22.630Z (6 months ago)
- Topics: danger, danger-plugin, ruby
- Language: Ruby
- Homepage: http://danger.systems/ruby/
- Size: 1.81 MB
- Stars: 17
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
A [Danger](http://danger.systems/ruby/) plugin. ([RubyGems](https://rubygems.org/gems/danger-auto_label))
### danger-auto_label
No more set label to issue or pull request manually.
Example, you can set labels simply by changing the PR title.
### Usage
Very simple usage.
First, install gem.
```
$ gem install danger-auto_label
```Set wip label automatically when the PR title contains '[WIP]'.
```sample.rb
if github.pr_title.include? "[WIP]"
auto_label.wip=(github.pr_json["number"])
else
auto_label.remove("WIP")
# If you want to delete label
# auto_label.delete("WIP")
end
```#### Methods
`wip=` - Set WIP label to PR.
```ruby
# Add "WIP" label to this Pull Request
pr_number = github.pr_json["number"]
auto_label.wip=(pr_number)
````set` - Set any labels to PR by this.
```ruby
# Add "Orange Label" with orange color to this Pull Request
# Note: will create label if it does not exist
pr_number = github.pr_json["number"]
auto_label.set(pr_number, "Orange Label", "ff8800")
````delete` - Delete any labels from repository.
```ruby
# Remove "Orange Label" from this Repository (use with caution!)
auto_label.delete("Orange Label")
````remove` - Remove any labels from PR.
```ruby
# Remove "Orange Label" from this Pull Request
auto_label.remove("Orange Label")
```