ruboty-circle_ci_v2 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b854db3327ddfbe3bd7c0b22811646342596f9da8de867b8e9bdce61720a48d3
4
- data.tar.gz: c37e39fea9e9bde5068a0e963615b62a667cd14e426a177a83fa527b7a3fb76c
3
+ metadata.gz: 9a17eade376fea81db660fa7363196bf72c12ba21ead14ca393654fcf6e16c79
4
+ data.tar.gz: 629ffd5194262cb01b861ca646b146e2ab55c2ae96cfbf398bce95a41fb9a102
5
5
  SHA512:
6
- metadata.gz: 79ebea2ee3f89dbace5e7b9ea3be3c7ca86af64ead425c10615d8d3e2148d3ab9b89ddceacf92f81be70ba4757b559a50f9e5bd7cc59d26b467df56941cfce86
7
- data.tar.gz: 1c7e708b93f1d03549c101cf433351f3b4ded29e6cd22f74ca92188757c005c60a795b40aa11c5b1b96ad5789441d3d2c8225584b2aa91bfed2890a5e2b8baca
6
+ metadata.gz: cba253e56fd30d65b1683d05b33b2212b58a75e030bbe6ab5819477f2521177c82b709c3d409b87ba3483e386958b6cbf1f503981ebdf88ffb520aae08e07963
7
+ data.tar.gz: c781c521dc0a190af68df16230c3bbad8b52de5146ecc0255776187e37b91dc236a37ce8ac2aa031e9ce2bfb27852ec35a697093bc8f24d6bd6adc98966435be
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruboty-circle_ci_v2 (0.1.0)
4
+ ruboty-circle_ci_v2 (0.3.0)
5
5
  faraday
6
6
  ruboty
7
7
 
@@ -23,10 +23,17 @@ module Ruboty
23
23
 
24
24
  workflow_response = connection.get("pipeline/#{pipeline["id"]}/workflow")
25
25
  workflow = JSON.parse(workflow_response.body)
26
+
27
+ if workflow["items"].empty?
28
+ pipeline_url = "https://app.circleci.com/pipelines/#{project_slug}?#{URI.encode_www_form(branch: branch)}"
29
+ message.reply("Triggered #{pipeline_url}")
30
+ return
31
+ end
32
+
26
33
  workflow_item_id = workflow["items"].first["id"]
27
- workflow_item_url = "https://app.circleci.com/pipelines/#{project_slug}/#{pipeline["number"]}/workflows/#{workflow_item_id}"
34
+ workflow_url = "https://app.circleci.com/pipelines/#{project_slug}/#{pipeline["number"]}/workflows/#{workflow_item_id}"
28
35
 
29
- message.reply("Triggered #{workflow_item_url}")
36
+ message.reply("Triggered #{workflow_url}")
30
37
  rescue => e
31
38
  message.reply("An error has occurred: #{e.message}")
32
39
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module CircleCIV2
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-circle_ci_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Suzuki