popomore / github-labels

Add github labels automatically
177 stars 20 forks source link

Create labels seems to work but do not add labels :s #12

Closed MoOx closed 9 years ago

MoOx commented 9 years ago
$ cat ~/.github-issues-labels      
[
  {"name": "bug", "color": "ffffff"},
  {"name": "feature", "color": "000000"}
]

$ labels -c ~/.github-issues-labels stylelint/stylelint -f
>> Authorized
>> Delete existing labels
>> Create labels
>> Done

$ labels -c ~/.github-issues-labels stylelint/stylelint   
>> Authorized
>> Create labels
>> Done

And I get nothing here https://github.com/stylelint/stylelint/labels

What is wrong ?

popomore commented 9 years ago

I don't know where is the problem, I tried your config in my repo https://github.com/popomore/test/labels

popomore commented 9 years ago

Should log the label

./bin/labels -c ./a.json popomore/test -f
>> Authorized
>> Delete existing labels
>> Create labels
>>   Create label bug
>>   Create label feature
>> Done
MoOx commented 9 years ago

Sounds good to do that for a start :)

(Note that -f (delete) worked on this repo)

MoOx commented 9 years ago

Maybe it is because it's on an org, not on a user repo ? Can this be related ?

popomore commented 9 years ago

Maybe, I have not test it on org.

popomore commented 9 years ago

Also worked on org, see https://github.com/test-labels/test/labels

./bin/labels -c ./a.json test-labels/test -f 
>> Authorized
>> Delete existing labels
>> Create labels
>>   Create label bug
>>   Create label feature
>> Done
MoOx commented 9 years ago

:sob:

MoOx commented 9 years ago

I will try to investigate.

popomore commented 9 years ago

You can compare old and label

https://github.com/popomore/github-labels/blob/master/lib/label.js#L29

popomore commented 9 years ago

Is it fixed?

MoOx commented 9 years ago

Ok I just make some tests and it seems it only works with .json files. If you use a json file wich does not have .json extension, it just provide a configs set to null.

MoOx commented 9 years ago

Probably related to how commander works.

MoOx commented 9 years ago

Hum it's more how you handle config file in your index.js

popomore commented 9 years ago

I'll look at it.

popomore commented 9 years ago

I have released 0.5.2, you can have a try.