Skip to content

Commit

Permalink
Create Doc PR on main
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentBaer authored and Vincent Baer committed Dec 12, 2022
1 parent 9d322da commit c28aff7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/scripts/git_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function github_pr {
echo "Pr Already exist"
else
git checkout "$GIT_USE_BRANCH"
result=$(curl -s -X POST -H "Authorization: token $SECRET_GITHUB_TOKEN" -d "{\"head\":\"$GIT_BRANCH\",\"base\":\"main\",\"title\":\"$GIT_TITLE\",\"body\":\"$GIT_CONTENT_BODY\"}" "https://api.github.com/repos/$GH_ORG_NAME/$GH_REPO_NAME/pulls")
result=$(curl -s -X POST -H "Authorization: token $SECRET_GITHUB_TOKEN" -d "{\"head\":\"$GH_ORG_NAME:$GIT_BRANCH\",\"base\":\"main\",\"title\":\"$GIT_TITLE\",\"body\":\"$GIT_CONTENT_BODY\"}" "https://api.github.com/repos/$GH_ORG_NAME/$GH_REPO_NAME/pulls")
errors=$(echo "$result" | jq .errors)
if [ "$errors" != "null" ]; then
echo "$errors"
Expand Down Expand Up @@ -158,7 +158,7 @@ function check_gh {
}


optstring=":g:o:r:n:e:t:p:m:b:c:u:"
optstring=":g:o:r:n:e:t:p:m:b:c:u:f:"
while getopts ${optstring} arg; do
case ${arg} in
g)
Expand All @@ -170,6 +170,9 @@ while getopts ${optstring} arg; do
r)
GH_REPO_NAME=${OPTARG}
;;
f)
GH_ORG_USERNAME=${OPTARG}
;;
n)
GIT_USERNAME=${OPTARG}
;;
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function check_gh {
else
echo "GH_ORG_NAME is set to '$GH_ORG_NAME'"
fi

if [ -z "${GH_REPO_NAME}" ]; then
echo "GH_REPO_NAME is unset":
echo "Set default Values";
Expand Down Expand Up @@ -117,8 +118,7 @@ function get_name {
fi
done
done
echo "-o ${GH_ORG_NAME} -r ${GH_REPO_NAME} -u ${GIT_CURRENT_BRANCH} -n ${GIT_USERNAME} -e ${GIT_USEREMAIL} -t add_${k8s_version} -b add-k8s-${k8s_version} -m add_${k8s_version} -c add_${k8s_version} -p $GIT_FILE_PATH -g $root/bin/gh"
"$root"/.github/scripts/git_command.sh -o "${GH_ORG_NAME}" -r "${GH_REPO_NAME}" -u "${GIT_CURRENT_BRANCH}" -n "${GIT_USERNAME}" -e "${GIT_USEREMAIL}" -t add_"${k8s_version}" -b add-k8s-"${k8s_version}" -m Update_kubernetes_OMI_""${k8s_version}" -c add_"${k8s_version}" -p "$GIT_FILE_PATH" -g "$root"/bin/gh
"$root"/.github/scripts/git_command.sh -o "${GH_ORG_NAME}" -r "${GH_REPO_NAME}" -u "${GIT_CURRENT_BRANCH}" -n "${GIT_USERNAME}" -e "${GIT_USEREMAIL}" -t add_"${k8s_version}" -b add-k8s-"${k8s_version}" -m Update_kubernetes_OMI_"${k8s_version}" -c add_"${k8s_version}" -p "$GIT_FILE_PATH" -g "$root"/bin/gh
}


Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OSC_ACCESS_KEY ?= access
OSC_SECRET_KEY ?= secret
OSC_CLUSTER ?= cluster-api
CLUSTER ?= cluster-api
GH_ORG_NAME ?= outscale-dev
GH_ORG_NAME ?= outscale-dev
GH_REPO_NAME ?= cluster-api-provider-outscale
GIT_USERNAME ?= Outscale Bot
GIT_USEREMAIL ?= opensource+bot@outscale.com
Expand Down Expand Up @@ -121,7 +121,7 @@ mock-generate: mockgen ## Generate mock

.PHONY: generate-image-docs
generate-image-docs:
./.github/scripts/launch.sh -c ${GIT_BRANCH} -o ${GH_ORG_NAME} -r ${GH_REPO_NAME} -n ${GIT_USERNAME} -e ${GIT_USEREMAIL}
./.github/scripts/launch.sh -c "${GIT_BRANCH}" -o "${GH_ORG_NAME}" -r "${GH_REPO_NAME}" -n "${GIT_USERNAME}" -e "${GIT_USEREMAIL}"

.PHONY: fmt
fmt: ## Run go fmt against code.
Expand Down

0 comments on commit c28aff7

Please sign in to comment.