heroku-review-apps-manager 0.1.0 → 0.2.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: 2bcfc7d7fcf1e47de4940cd7b4c83e79f424edc7e9a34c6e7384e356c60ee0cd
4
- data.tar.gz: 9c7249cd1a08a6a4d3fb28b0f892f1531cf0eebb763bc7dc08c7b04fa2492633
3
+ metadata.gz: 205926cb151b667ce4a00721570a4e3f67eb94e41079ed44078e9023538abacf
4
+ data.tar.gz: 9161977a5bcc94c2af48810b11b97a79930939ea7a3ca10e8fd87502aa52c2bd
5
5
  SHA512:
6
- metadata.gz: 9440388b83d8baf85653cb0a5f7d0b893b36ff9a28936e5c5ec148a606292cb55fb6c24a532d319a2316a088c9b15aa7af92eb4373ea06f27066ab879d3a09fe
7
- data.tar.gz: cf836d574ed9a6ceadceaffc54575c8376f32f67e21fd1e0fd5414f6b69b948c92d32a843fbd0cdf344cd86f6dbed8daf3b90e1c2c15629e7bc52a8321a0d3c7
6
+ metadata.gz: '03149d9440968111d9b39e6d3b2f9281d3a7bb1312cee7405c5052fe741777e16a38a1eca7fcbfd363422f69c0b210e2a0fc0fab0f5dc93888aea8c79f8d65b1'
7
+ data.tar.gz: 7272a650ca7608b6417b90b0fec0884aea094b23365ebed8b7643a7b1b2b1bb8f9008579bb5360d9562a7299b3b606e2661612c4e3d17a7ecf6593576c5772f9
data/README.md CHANGED
@@ -42,6 +42,14 @@ Your GitHub personal access token (required for creating review apps). You can c
42
42
  export HEROKU_REVIEW_APPS_MANAGER_GITHUB_TOKEN=your_github_token
43
43
  ```
44
44
 
45
+ ### `HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY` (Optional)
46
+
47
+ The default GitHub repository in the format `org/repo` (e.g., `myorg/myrepo`). This is used as a fallback when the repository is not specified in the `create_app` command.
48
+
49
+ ```bash
50
+ export HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY=myorg/myrepo
51
+ ```
52
+
45
53
  ## Usage
46
54
 
47
55
  ### List review apps
@@ -63,19 +71,27 @@ $ heroku-review-apps-manager list_app PIPELINE_NAME --json
63
71
  Create a review app for a specific branch and pull request:
64
72
 
65
73
  ```bash
66
- $ heroku-review-apps-manager create_app PIPELINE_NAME GITHUB_ORG REPOSITORY BRANCH
74
+ $ heroku-review-apps-manager create_app PIPELINE_NAME BRANCH [REPOSITORY]
67
75
  ```
68
76
 
69
- Example:
77
+ The `REPOSITORY` parameter is optional. If not provided, it will use the value from the `HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY` environment variable. The repository should be in the format `org/repo`.
78
+
79
+ Example with repository specified:
80
+
81
+ ```bash
82
+ $ heroku-review-apps-manager create_app my-pipeline feature-branch myorg/myrepo
83
+ ```
84
+
85
+ Example using environment variable:
70
86
 
71
87
  ```bash
72
- $ heroku-review-apps-manager create_app my-pipeline myorg myrepo feature-branch
88
+ $ heroku-review-apps-manager create_app my-pipeline feature-branch
73
89
  ```
74
90
 
75
91
  With JSON output:
76
92
 
77
93
  ```bash
78
- $ heroku-review-apps-manager create_app PIPELINE_NAME GITHUB_ORG REPOSITORY BRANCH --json
94
+ $ heroku-review-apps-manager create_app PIPELINE_NAME BRANCH [REPOSITORY] --json
79
95
  ```
80
96
 
81
97
  ### Delete a review app
@@ -77,17 +77,19 @@ module Heroku
77
77
 
78
78
  desc "create_app", "Create review app"
79
79
  option :json, type: :boolean, default: false
80
- def create_app(pipeline_name, org, repository, branch)
80
+ def create_app(pipeline_name, branch, repository = nil)
81
81
  platform_api = PlatformAPI.connect_oauth(ENV["HEROKU_REVIEW_APPS_MANAGER_HEROKU_API_KEY"])
82
82
  octokit = Octokit::Client.new(access_token: ENV["HEROKU_REVIEW_APPS_MANAGER_GITHUB_TOKEN"])
83
+ repository ||= ENV["HEROKU_REVIEW_APPS_MANAGER_TARGET_GITHUB_REPOSITORY"]
84
+ org = repository.split("/").first
83
85
 
84
86
  pipeline = platform_api.pipeline.info(pipeline_name)
85
87
  pipeline_id = pipeline["id"]
86
88
 
87
- github_archive_link = octokit.archive_link("#{org}/#{repository}", ref: branch)
89
+ github_archive_link = octokit.archive_link(repository, ref: branch)
88
90
 
89
91
  pull_requests = octokit.pull_requests(
90
- "#{org}/#{repository}",
92
+ repository,
91
93
  state: "all",
92
94
  head: "#{org}:#{branch}"
93
95
  )
@@ -4,7 +4,7 @@ module Heroku
4
4
  module Review
5
5
  module Apps
6
6
  module Manager
7
- VERSION = "0.1.0"
7
+ VERSION = "0.2.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-review-apps-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kakudooo