Skip to content

Commit

Permalink
typos and cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas committed Nov 1, 2023
1 parent 02bf14d commit 0d511ba
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
18 changes: 9 additions & 9 deletions hooks/common/post-flow-feature-publish
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
source "$HOOKS_DIR"/functions.sh

if ! get_config_bool gitflow.use-pull-request true; then
verbose "Pull requests are disabled. Skipping PR creation."
verbose "Pull requests are disabled. Skipping Pull Request creation."
exit 0
fi

Expand All @@ -43,8 +43,8 @@ if [[ $ORIGIN_URL =~ ^git@github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the feature branch after the PR is merged. It will be deleted automatically when the feature is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the feature branch after the Pull Request is merged. It will be deleted automatically when the feature is finished."
echo ""
fi
elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
Expand All @@ -59,15 +59,15 @@ elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the feature branch after the PR is merged. It will be deleted automatically when the feature is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the feature branch after the Pull Request is merged. It will be deleted automatically when the feature is finished."
echo ""
fi
elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/^git@bitbucket\.org://' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
Expand All @@ -85,7 +85,7 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/https:\/\/.*bitbucket\.org\///' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
Expand All @@ -100,8 +100,8 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then
EOM
die_on_error "Failed to create a Pull Request"
else
echo "Create a PR manually at $ORIGIN_URL"
echo "Do not delete the feature branch after the PR is merged. It will be deleted automatically when the feature is finished."
echo "Create a Pull Request manually at $ORIGIN_URL"
echo "Do not delete the feature branch after the Pull Request is merged. It will be deleted automatically when the feature is finished."
fi

exit 0
22 changes: 11 additions & 11 deletions hooks/common/post-flow-hotfix-publish
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
source "$HOOKS_DIR"/functions.sh

if ! get_config_bool gitflow.use-pull-request true; then
verbose "Pull requests are disabled. Skipping PR creation."
verbose "Pull requests are disabled. Skipping Pull Request creation."
exit 0
fi

Expand All @@ -43,8 +43,8 @@ if [[ $ORIGIN_URL =~ ^git@github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the hotfix branch after the PR is merged. It will be deleted automatically when the hotfix is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the hotfix branch after the Pull Request is merged. It will be deleted automatically when the hotfix is finished."
echo ""
fi
elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
Expand All @@ -59,22 +59,22 @@ elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the hotfix branch after the PR is merged. It will be deleted automatically when the hotfix is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the hotfix branch after the Pull Request is merged. It will be deleted automatically when the hotfix is finished."
fi
elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/^git@bitbucket\.org://' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
--header 'Content-Type: application/json' \
--data @- <<EOM
{
"title": "Merge $BRANCH",
"description": "Feature $VERSION. Do not delete the feature branch after the merge.",
"description": "Hotfix $VERSION. Do not delete the hotfix branch after the merge.",
"destination": { "branch": { "name": "$MASTER_BRANCH" } },
"source": { "branch": { "name": "$BRANCH" } }
}
Expand All @@ -84,23 +84,23 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/https:\/\/.*bitbucket\.org\///' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
--header 'Content-Type: application/json' \
--data @- <<EOM
{
"title": "Merge $BRANCH",
"description": "Feature $VERSION. Do not delete the feature branch after the merge.",
"description": "Hotfix $VERSION. Do not delete the hotfix branch after the merge.",
"destination": { "branch": { "name": "$MASTER_BRANCH" } },
"source": { "branch": { "name": "$BRANCH" } }
}
EOM
die_on_error "Failed to create a Pull Request"
else
echo "Create a PR manually at $ORIGIN_URL"
echo "Do not delete the hotfix branch after the PR is merged. It will be deleted automatically when the hotfix is finished."
echo "Create a Pull Request manually at $ORIGIN_URL"
echo "Do not delete the hotfix branch after the Pull Request is merged. It will be deleted automatically when the hotfix is finished."
fi

exit 0
22 changes: 11 additions & 11 deletions hooks/common/post-flow-release-publish
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
source "$HOOKS_DIR"/functions.sh

if ! get_config_bool gitflow.use-pull-request true; then
verbose "Pull requests are disabled. Skipping PR creation."
verbose "Pull requests are disabled. Skipping Pull Request creation."
exit 0
fi

Expand All @@ -43,8 +43,8 @@ if [[ $ORIGIN_URL =~ ^git@github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the release branch after the PR is merged. It will be deleted automatically when the release is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the release branch after the Pull Request is merged. It will be deleted automatically when the release is finished."
echo ""
fi
elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
Expand All @@ -59,23 +59,23 @@ elif [[ $ORIGIN_URL =~ ^https://github\.com ]]; then
die_on_error "Failed to create a Pull Request"
else
echo ""
echo "Create PR at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the release branch after the PR is merged. It will be deleted automatically when the release is finished."
echo "Create Pull Request at: https://github.com/$repo/compare/$BRANCH?expand=1"
echo "Do not delete the release branch after the Pull Request is merged. It will be deleted automatically when the release is finished."
echo ""
fi
elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/^git@bitbucket\.org://' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
--header 'Content-Type: application/json' \
--data @- <<EOM
{
"title": "Merge $BRANCH",
"description": "Feature $VERSION. Do not delete the feature branch after the merge.",
"description": "Release $VERSION. Do not delete the release branch after the merge.",
"destination": { "branch": { "name": "$MASTER_BRANCH" } },
"source": { "branch": { "name": "$BRANCH" } }
}
Expand All @@ -85,23 +85,23 @@ elif [[ $ORIGIN_URL =~ ^https://.*bitbucket\.org ]]; then
repo=$(echo $ORIGIN_URL | sed -e 's/https:\/\/.*bitbucket\.org\///' -e 's/\.git$//')
token=$(get_config bitbucket.api.access-token)
[[ -z $token ]] && die "Bitbucket's API Access Token is empty"
verbose "Creating a PR on repository $repo"
verbose "Creating a Pull Request on repository $repo"
curl https://api.bitbucket.org/2.0/repositories/${repo}/pullrequests \
--request POST \
--header "Authorization: Bearer ${token}" \
--header 'Content-Type: application/json' \
--data @- <<EOM
{
"title": "Merge $BRANCH",
"description": "Feature $VERSION. Do not delete the feature branch after the merge.",
"description": "Release $VERSION. Do not delete the release branch after the merge.",
"destination": { "branch": { "name": "$MASTER_BRANCH" } },
"source": { "branch": { "name": "$BRANCH" } }
}
EOM
die_on_error "Failed to create a Pull Request"
else
echo "Create a PR manually at $ORIGIN_URL"
echo "Do not delete the release branch after the PR is merged. It will be deleted automatically when the release is finished."
echo "Create a Pull Request manually at $ORIGIN_URL"
echo "Do not delete the release branch after the Pull Request is merged. It will be deleted automatically when the release is finished."
fi

exit 0
2 changes: 1 addition & 1 deletion hooks/common/pre-flow-hotfix-finish
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ elif [[ $ORIGIN_URL =~ ^git@bitbucket\.org ]]; then
.values |= sort_by(.updated_on) |
last(.values[] | select(.source.branch.name == $BRANCH) | .state)'
)
die_on_error "There is no Pull Request for branch $BRANCH, please publish this release before finishing it."
die_on_error "There is no Pull Request for branch $BRANCH, please publish this hotfix before finishing it."
if [[ $PR_STATE != MERGED ]]; then
die "There is a Pull Request that is not yet merged, please wait (Status: $PR_STATE)"
fi
Expand Down

0 comments on commit 0d511ba

Please sign in to comment.