We want to be able to have a GitHub Actions workflow kick off a Bonsai asset recompile.
The current webhook approach is racy, because the release event it relies on comes before all the asset builds are uploaded into the GitHub release, causing recompile errors and forcing people to manually recompile.
The new build/ api approach requires personal access tokens to be generated, which is cumbersome as it can't be fully automated.
The generated GitHub Action tokens aren't tied to a user, so fail the collaborator check we have in place. And ther doesn't appear to be a way to figure out that a specific token is a GitHub Action token.
Possible Solution
Refactor the webhook logic to trigger on completed workload_job events with a specific workload name.
Refactor automatic webhook generation to create a repository webhook that subscribes to workflow_job events instead of release events
Add logic on recieving a workflow_job event check that the job name is "bonsai-recompile" the event action is completed and if so kick off a recompile request for the repository listed in the workflow_job event
GitHub Action refactor
Have GitHub Action logic that runs a "bonsai-recompile" job after successful release workflow.
Problem Statement
We want to be able to have a GitHub Actions workflow kick off a Bonsai asset recompile. The current webhook approach is racy, because the release event it relies on comes before all the asset builds are uploaded into the GitHub release, causing recompile errors and forcing people to manually recompile.
The new build/ api approach requires personal access tokens to be generated, which is cumbersome as it can't be fully automated. The generated GitHub Action tokens aren't tied to a user, so fail the collaborator check we have in place. And ther doesn't appear to be a way to figure out that a specific token is a GitHub Action token.
Possible Solution
Refactor the webhook logic to trigger on
completed
workload_job events with a specific workload name.Ref: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job
Straw Implementation
Bonsai refactor
workflow_job
events instead ofrelease
eventsworkflow_job
event check that the job name is "bonsai-recompile" the event action iscompleted
and if so kick off a recompile request for the repository listed in theworkflow_job
eventGitHub Action refactor