diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/template_func_proto.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/template_func_proto.c b/src/template_func_proto.c new file mode 100644 index 0000000..459a3a6 --- /dev/null +++ b/src/template_func_proto.c @@ -0,0 +1,18 @@ +#include "template_func_proto.h" + +int get_github_release_notes_tplfunc_entrypoint(void *frame, void *ptr) { + int result; + char **output = (char **) ptr; + struct tplfunc_frame *f = (struct tplfunc_frame *) frame; + char *api_token = getenv("STASIS_GITHUB_TOKEN"); + if (!api_token) { + api_token = getenv("GITHUB_TOKEN"); + } + result = get_github_release_notes(api_token ? api_token : "anonymous", + (const char *) f->argv[0].t_char_ptr, + (const char *) f->argv[1].t_char_ptr, + (const char *) f->argv[2].t_char_ptr, + output); + return result; +} + |