I have an API set up with Postman Teams, connected to a GitHub repository. I can publish the API without issues using the Postman desktop app. However, I’m encountering difficulties when trying to publish the API via the Postman CLI.
Here’s what I do:
- Clone the GitHub repository to my local machine outside of Postman.
- Run the following command at the root folder of the git repo:
postman api publish [api id] --name v1 --release-notes "Demo release notes" --api-definition "C:\Users\x\source\repos\github\x\apis\openapi\index.json"
The command starts with “Fetching contents to publish” but immediately fails and returns
The system cannot find the path specified.
Error: Unable to find a git branch connected to this API. Try running the command again with correct git repository folder or CI pipeline.