How to change API call user for fetching .drone.yml

Hi all,

According to this Error cannot find yaml - FAQ - Drone Drone makes API calls to fetch the Yaml on behalf of the user that activated the repository.

We are using Drone with Bitbucket Server and for one of our accounts in Bitbucket persmissions were revoked(cannot be undone) and multiple repos stopped building.

We can fix it manually from GUI - deactivate and active every repo but…
Is there any way to change the user/account that Drone is making this API calls in bulk for example from database?

I’ve already tried changing repo_user_id in repo table but with no results.

Any help is appreciated
Mat

How to change API call user for fetching .drone.yml

Drone uses the token of the individual that enabled the repository. To change the user account used to fetch the yaml, you would disable the repository and re-enable the repository; when you re-enable the repository, Drone will start using your token.

If you want to do this in bulk you could use the CLI and write a bash script that lists all repositories, and then executes the repair command:
https://docs.drone.io/cli/repo/drone-repo-ls/
https://docs.drone.io/cli/repo/drone-repo-repair/

Great! Thanks for your help :slight_smile: