Hello Bitbucket Community,
I'm currently automating some of our workflows using Bitbucket Pipelines and faced an issue when trying to authenticate API requests to Bitbucket's REST API. I attempted to use `BITBUCKET_STEP_OIDC_TOKEN` for this purpose, specifically to post comments on pull requests. Here's the curl command I used:
```sh
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/pullrequests/${BITBUCKET_PR_ID}/comments' \
--header 'Authorization: Bearer ${BITBUCKET_STEP_OIDC_TOKEN}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "content": { "raw": "what" } }'
```
However, this approach doesn't seem to work, and I suspect the `BITBUCKET_STEP_OIDC_TOKEN` might not be valid for this type of API request. I would appreciate any guidance on the following:
1. Is `BITBUCKET_STEP_OIDC_TOKEN` intended for use with Bitbucket's own API?
2. What is the recommended method for posting PR comments from a pipeline?
Any advice or examples would be greatly appreciated.
Thank you in advance for your help!