I created an automation in Jira, which creates a branch whenever a card is moved in Jira. This automation uses a web request to trigger the Github API.
My problem is that this branch is being created based on the fixed hash of a commit, so it is not being created updated.
Below is the Github documentation I used to put together the automation.
I need to know which Github API allows me to create a branch, always starting from its last commit.
Link utilizado para obter as informações
text
URL Request: https://api.github.com/repos/$OWNER/$REPO/git/refs
Method: POST
Body: {
“ref”: “refs/heads/{{issue.key}}”,
“sha”: “b9300dac61853fbf6cc2e7599968d5fde1ee9454”
}
URL used to obtain the SHA
SHA: https://api.github.com/repos/$OWNER/$REPO/branches/$BRANCH
Token: $TOKEN GitHub
I couldn’t get it to work correctly
Prodati Sistemas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.