Skip to content

Commit 9e662a3

Browse files
authored
Merge pull request #24 from leonhartX/support-private-repo
support create private repo from gas
2 parents 785b745 + 7accbb3 commit 9e662a3

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

Dangerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
22
warn("Big PR, try to keep changes smaller if you can") if git.lines_of_code > 500
3+
warn("manifest is not changed, forget to bump version?") if !git.modified_files.include?("manifest.json")
34

5+
github.dismiss_out_of_range_messages
46
eslint.filtering = true
57
eslint.lint
6-
lgtm.check_lgtm
8+
lgtm.check_lgtm

circle.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ dependencies:
66
test:
77
override:
88
- danger
9+
10+
deployment:
11+
production:
12+
branch: master
13+
commands:
14+
- zip -r gas-github.zip . -x 'node_modules/*' -x '\.*' -x 'circle.yml' -x 'Dangerfile' -x 'Gemfile*'
15+
- mv gas-github.zip $CIRCLE_ARTIFACTS

content/modal.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
<td><div>Description</div></td>
4747
<td><input id="new-repo-desc" class="editable-row-input large-input" type="text"></td>
4848
</tr>
49+
<tr class="properties-data-dialog-table-row">
50+
<td><div>Type</div></td>
51+
<td><div style="white-space: normal;">
52+
<select id="new-repo-type">
53+
<option value="public">Public</option>
54+
<option value="secret">Private</option>
55+
</select>
56+
</div></td>
57+
</tr>
4958
</tbody>
5059
</table>
5160
</div>

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.0",
2+
"version": "2.0.1",
33
"manifest_version": 2,
44
"default_locale": "en",
55
"name": "__MSG_appName__",

src/github-api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,12 @@ function getGithubRepos() {
282282
function githubCreateRepo() {
283283
const repo = $('#new-repo-name').val();
284284
const desc = $('#new-repo-desc').val();
285+
const isPrivate = $('#new-repo-type').val() !== 'public';
285286
const payload = {
286287
name : repo,
287288
description : desc,
288-
auto_init : true
289+
auto_init : true,
290+
private: isPrivate
289291
}
290292
if (!repo || repo === "") return;
291293
new Promise((resolve, reject) => {
@@ -322,6 +324,7 @@ function githubCreateRepo() {
322324
.then(() => {
323325
$('#new-repo-name').val("");
324326
$('#new-repo-desc').val("");
327+
$('#new-repo-type').val("public");
325328
showAlert(`Successfully create new repository ${repo}`);
326329
})
327330
.catch((err) => {

0 commit comments

Comments
 (0)