Hi!
I have a use case where I need to trigger a build using the API, as explained here: https://docs.drone.io/api/builds/build_create/
POST /api/repos/{namespace}/{name}/builds?branch={branch}&{key=value}
But I also need to skip some of the steps that would normally run in a normal webhook-triggered build, based on the params that I pass in the URL.
Is that possible? I couldn’t find documentation for something like that.
Thanks,
Simon
Hi Simon,
Yes, this is possible using Starlark. I discuss this use case here. You can use these links to lear more about using Starlark and installing the server extension:
Note that in the coming weeks we will add Starlark support to Drone core which would eliminate the need to use a separate extension.
1 Like
Hi @bradrydzewski , thanks for the super quick response!
Does this mean I will have to convert my entire .drone.yml
file into a drone.star
file? Or can they be used together?
Simon
Hi Simon,
Yes, this means you would need to use Starlark as opposed to Yaml. The Starlark scripting language provides the power of a full programming language and would support your use case, but the tradeoff is that you would need to convert your Yaml to Starlark.