Skip to content

Commit

Permalink
fixed json issue
Browse files Browse the repository at this point in the history
  • Loading branch information
githubofkrishnadhas committed Dec 26, 2023
1 parent f7a326c commit 13e8383
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions create_repository_in_github.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#! /bin/bash
#!/bin/bash

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

curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/$ORGANIZATION/repos \
-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}'
-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 comments on commit 13e8383

Please sign in to comment.