I'm trying to create a scheduled pipeline which will retrieve from a Salesforce instance and create a Pull request with any changes that have been retrieved. Broadly speaking it:
- Checkouts "develop"
- Creates a new branch locally
- Retrieves from Salesforce
- Commits the changes
- Pushes the new branch to Bitbucket
- Calls the API to create a Pull Request for somebody to review and merge to "develop"
The issue is with step 6. The call to the API results in an error:
"source: branch not found: {{branch name is in here}}"
The bitbucket bash script has the following commands directly following each other:
- git push
- node {{reference to JS file which makes the API call}}
The branch name matches with the one just pushed. Is there an issue with timing (e.g. do we need to pause before making the API call), or is something else at play here?
EDITED TO ADD MORE DETAILS
- I've update my node script to include a delay, but that hasn't appeared to have worked
- I've used Postman API with the same bearer token and, as far as I can tell, the same API call and that is able to create the Pull Request as expected.