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 +4 -4
- data/README.md +20 -4
- data/lib/heroku/review/apps/manager/cli.rb +5 -3
- data/lib/heroku/review/apps/manager/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 205926cb151b667ce4a00721570a4e3f67eb94e41079ed44078e9023538abacf
|
|
4
|
+
data.tar.gz: 9161977a5bcc94c2af48810b11b97a79930939ea7a3ca10e8fd87502aa52c2bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
74
|
+
$ heroku-review-apps-manager create_app PIPELINE_NAME BRANCH [REPOSITORY]
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
|
|
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
|
|
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
|
|
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,
|
|
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(
|
|
89
|
+
github_archive_link = octokit.archive_link(repository, ref: branch)
|
|
88
90
|
|
|
89
91
|
pull_requests = octokit.pull_requests(
|
|
90
|
-
|
|
92
|
+
repository,
|
|
91
93
|
state: "all",
|
|
92
94
|
head: "#{org}:#{branch}"
|
|
93
95
|
)
|