generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically open PR after make update-helm-plugin-repo
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
- Loading branch information
1 parent
c89c2d7
commit d309c96
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 RELEASE_TAG" | ||
exit 1 | ||
fi | ||
|
||
RELEASE_TAG="$1" | ||
BRANCH_NAME="index-${RELEASE_TAG}" | ||
COMMIT_MESSAGE="This PR updates index.yaml for ${RELEASE_TAG}. Automatically generated by make update-helm-repo." | ||
PR_TITLE="🌱 Update helm chart index.yaml to ${RELEASE_TAG}" | ||
PR_DESCRIPTION="**What this PR does / why we need it:**\n\nThis PR updates index.yaml for ${RELEASE_TAG}. Automatically generated by \`make update-helm-repo\`." | ||
|
||
# Checkout index-${RELEASE_TAG} branch | ||
git checkout -b "${BRANCH_NAME}" | ||
|
||
# Add files to commit | ||
git add plugins/clusterctl-operator.yaml index.yaml | ||
|
||
# Commit changes with appropriate message | ||
git commit -m "${COMMIT_MESSAGE}" | ||
|
||
# Push changes to origin | ||
git push origin "${BRANCH_NAME}" | ||
|
||
if ! command -v gh &> /dev/null | ||
then | ||
echo "GitHub CLI (gh) is not installed." | ||
echo "Please open a pull request with the following details:" | ||
echo "Title: $PR_TITLE" | ||
echo -e "Description: \n$PR_DESCRIPTION" | ||
exit 0 | ||
fi | ||
|
||
# Open a PR with title and description | ||
gh pr create --title "${PR_TITLE}" --body "${PR_DESCRIPTION}" |