Is it possible to somehow pass only the changed files in bitbucket-pipelines.yml? I want to run PHP Code Sniffer only on changed files while creating pull request. I couldn't find answer anywhere, all solutions where that I should hardcode the path to the project files. Thanks!
you should be able to generate an app password that allows you to call specific bitbucket APIs.
then possibly using the pullrequest API (https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests) and/or diffstat API you could be able to figure out what files changed in the given changesets that comprise the pull request?
@mkleintyeap, that API endpoint did the trick, thanks :)
To be correct I used this one -> https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/diffstat as it provides a param for specific PR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you post how you integrated this in the yml file please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.