Skip to content

Commit 13e8383

Browse files
fixed json issue
1 parent f7a326c commit 13e8383

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

create_repository_in_github.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
#! /bin/bash
1+
#!/bin/bash
22

3-
#GH_TOKEN --> will be passed from workflow as env variable
3+
# GH_TOKEN --> will be passed from workflow as an env variable
4+
ORGANIZATION=$1
5+
REPOSITORY_NAME=$2
6+
REPOSITORY_DESCRIPTION=$3
7+
PRIVATE=$4
8+
VISIBILITY=$5
9+
HAS_ISSUES=$6
10+
HAS_PROJECTS=$7
11+
HAS_WIKI=$8
12+
GITIGNORE_TEMPLATE=$9
13+
LICENSE_TEMPLATE=${10}
14+
GH_TOKEN=${11}
415

516
curl -L \
617
-X POST \
718
-H "Accept: application/vnd.github+json" \
819
-H "Authorization: Bearer $GH_TOKEN" \
920
-H "X-GitHub-Api-Version: 2022-11-28" \
1021
https://api.github.com/orgs/$ORGANIZATION/repos \
11-
-d '{"name":$REPOSITORY_NAME,"description":$c,"homepage":"https://github.com/"$ORGANIZATION/$REPOSITORY_NAME","private":$VISIBILITY,"has_issues":$HAS_ISSUES,"visibility":$VISIBILITY,"has_projects":$HAS_PROJECTS,"has_wiki":$HAS_WIKI,"gitignore_template":$GITIGNORE_TEMPLATE,"license_template":$LICENSE_TEMPLATE}'
22+
-d '{"name":"'"$REPOSITORY_NAME"'","description":"'"$REPOSITORY_DESCRIPTION"'","homepage":"https://github.com/'"$ORGANIZATION/$REPOSITORY_NAME"'","private":'"$PRIVATE"',"has_issues":'"$HAS_ISSUES"',"visibility":"'"$VISIBILITY"'","has_projects":'"$HAS_PROJECTS"',"has_wiki":'"$HAS_WIKI"',"gitignore_template":"'"$GITIGNORE_TEMPLATE"'","license_template":"'"$LICENSE_TEMPLATE"'"}'

0 commit comments

Comments
 (0)