Starting Github Action Workflows From Observable

Tom Larkworthy
4 min readDec 27, 2021

Using Observable as the front end for Github Actions is a great way to provide a nice interface without the hassle of hosting anything. Recently I developed a notebook library that allows authenticated and unauthenticated users to kick off Action workflow via a repository dispatch.

A repository dispatch triggers Github Action workflows via an authenticated HTTP request. See the documentation on Github. From there you can do all kinds of things, even programmatically creating commits.

In this article, we document two major ways to trigger actions from Observable notebooks.

  1. authenticated, where notebook readers provide the access token to trigger a workflow
  2. pre-authenticated, where the notebook author configures a proxy using their own creds, so anybody can trigger workflows on the author’s blessed path.

Repository Dispatch Client Library for Observable

The authenticated dispatch function takes an access token, plus the other options, to perform the dispatch

Example Usecase 1: Pass Personal Token In Notebook

To use our simple dispatch function, we need a Github API access token. A simple way is to ask the reader for one.

--

--

Tom Larkworthy
Tom Larkworthy

Written by Tom Larkworthy

Observablehq/Cloud consultant. Developing webcode.run to serverless to Observablehq. Ex-Firebase, Ex-Google Cloud.

No responses yet