This repository was archived by the owner on Nov 8, 2018. It is now read-only.
File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,8 @@ Set the status message for `concourse-ci` context on specified pull request.
187
187
188
188
* `label`: *Optional.* A label to add to the pull request.
189
189
190
+ * `delete_label`: *Optional.* A label to remove from the pull request.
191
+
190
192
# # Example pipeline
191
193
192
194
Please see this repo's [pipeline](https://github.com/jtarchie/pullrequest-resource/blob/master/.concourse.yml) for a perfect example.
Original file line number Diff line number Diff line change @@ -71,6 +71,17 @@ def output
71
71
metadata << { 'name' => 'label' , 'value' => params . label }
72
72
end
73
73
74
+ if params . delete_label
75
+ label_exists = Octokit . labels_for_issue ( input . source . repo , id ) . select do |hash |
76
+ hash . to_hash [ :name ] == params . delete_label
77
+ end
78
+
79
+ if label_exists . any?
80
+ Octokit . remove_label ( input . source . repo , id , params . delete_label )
81
+ end
82
+ metadata << { 'name' => 'delete_label' , 'value' => params . delete_label }
83
+ end
84
+
74
85
if params . merge . method
75
86
commit_msg = if params . merge . commit_msg
76
87
commit_path = File . join ( destination , params . merge . commit_msg )
You can’t perform that action at this time.
0 commit comments