diff --git a/README.md b/README.md index 60d1ab0..d52de03 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ There are a few builtin decoders and post hooks, to support some common use cases. For example decoding events from a oci distribution registry, or opening a pull request on github. -The starlark code for the builtins can be reviewed in the [builtin](./builtin) +The starlark code for the builtins can be reviewed in the [builtin](./plugin/builtin) directory. #### Decoder diff --git a/plugin/builtin/starlark/decoder.harbor@v1.star b/plugin/builtin/starlark/decoder.harbor@v1.star new file mode 100644 index 0000000..4585529 --- /dev/null +++ b/plugin/builtin/starlark/decoder.harbor@v1.star @@ -0,0 +1,12 @@ +load("encoding/json.star", "json") + +def main(input): + data = json.decode(input) + + event = data["event_data"] + + output = [] + for resource in event["resources"]: + output.append(resource["resource_url"]) + + return output