This repository was archived by the owner on Nov 8, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 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.
187187
188188* `label`: *Optional.* A label to add to the pull request.
189189
190+ * `delete_label`: *Optional.* A label to remove from the pull request.
191+
190192# # Example pipeline
191193
192194Please 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
7171 metadata << { 'name' => 'label' , 'value' => params . label }
7272 end
7373
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+
7485 if params . merge . method
7586 commit_msg = if params . merge . commit_msg
7687 commit_path = File . join ( destination , params . merge . commit_msg )
You can’t perform that action at this time.
0 commit comments