From the GH API docs, we can set custom commit statuses. Our case requires us to set a custom link for the target_url
parameter, for our drone builds instead of the default build URL. How can we achieve this?
1 Like
Drone does not provide this option, however, you can disable the default Drone status and set your own. There are a few different approaches you could take, but this would be the easiest:
steps:
- name: status
image: ...
commands:
- >
curl -X POST -d '{
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"context": "continuous-integration/drone"
}' https://api.github.com/repos/foo/bar/statuses/${DRONE_COMMIT}
1 Like
Is auth handled automatically?
no, you would need to handle auth. the above example is just pseudocode and may require modification to work in your pipeline.
Understood. Isn’t there any plugin for this?
Edit: Nevertheless, thanks!