Hello all, I am in the process of setting up infra...
# help
r
Hello all, I am in the process of setting up infracost in a Bitbucket pipeline. I've used your example on https://bitbucket.org/infracost/infracost-bitbucket-pipeline/src/master/ but I've noticed that for comments on pull requests the documentation mentions using an app password under my account. Is it also possible to use a repository access token or something like that? Or should I just have infracost generate output and then do the comments on a pullrequest via an API call? Context: I would like for teammates to be able to use the pipeline when they do pull requests, without comments showing up under my own account 🙂. If I need to explain anything further, let me know.
l
@rhythmic-ambulance-95028 it’s not something I’ve tried, but reading the docs about it I think it should work as long as the repository access token has write access to the pull request.
Have just tested it out and it works fine if you just pass something like this to the
infracost comment
command:
--bitbucket-token=$BITBUCKET_REPO_TOKEN
r
Will give that a try, thx!
So I just need to define BITBUCKET_REPO_TOKEN using the secret generated for the repository access token in the Bitbucket repository itself?
l
Yes. And the secret needs to have the Pull Request Write permission enabled.
r
This works for me as well, thanks for the quick reply!
l
Thanks @rhythmic-ambulance-95028, we’ve updated our docs to have this now as well simple smile https://bitbucket.org/infracost/infracost-bitbucket-pipeline/pull-requests/18