Feature: Add support for more fields, allow branch+commit+tag, fix error output#37
Open
henrygrant wants to merge 2 commits intoTumiya:developfrom
Open
Feature: Add support for more fields, allow branch+commit+tag, fix error output#37henrygrant wants to merge 2 commits intoTumiya:developfrom
henrygrant wants to merge 2 commits intoTumiya:developfrom
Conversation
Author
|
Curious about what anyone else thinks about the non-mutual-exclucivity of |
Macjon
reviewed
Nov 22, 2024
| "branch": "$BRANCH", | ||
| "branch_dest": "$BRANCH_DEST", | ||
| "commit_hash": "$COMMIT", | ||
| "commit_message": "$MESSAGE", |
There was a problem hiding this comment.
I've tested this implementation and this will not work when your commit message contains spaces. I changed the generate_build_payload() implementation so it used jq to create the payload.
function generate_build_payload() {
local environments=$(process_env_vars "$ENV_STRING")
jq -n --arg branch "$BRANCH" \
--arg commit "$COMMIT" \
--arg message "$MESSAGE" \
--arg tag "$TAG" \
--arg workflow "$WORKFLOW" \
--argjson environments "$environments" \
'{
build_params: {
branch: $branch,
commit_hash: $commit,
commit_message: $message,
tag: $tag,
workflow_id: $workflow,
environments: $environments
},
hook_info: {
type: "bitrise"
}
}'
}
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds some additional parameters you can feed to the Bitrise API. These were necessary for more context in our Bitrise builds, and enabling auto-aborting of repeated builds to branches with open PRs.
I also removed the guard that requires only one of [branch|tag|commit] as params. Even though the documentation indicates you are only supposed to have one of these, the commit information still gets populated when you push a value for
-band-c.This was an issue for my team, as we moved from webhooks to using Gitrise, but upon doing so and passing
-bfor the branch name, we lost commit context. This got it back for us.Also, it seems like bitrise changed the key of the error message in the response object from
messagetoerror_msg. Addressed in this MR.