githubplugin

package module
v1.0.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 6 Imported by: 0

README

workflow-plugin-github

⚠️ Experimental — This plugin compiles and passes its unit tests but has not been validated in any active GoCodeAlone-internal production deployment. Use with caution. Please open an issue if you adopt it so we can promote it to verified status.

GitHub integration plugin for the workflow engine. Provides GitHub webhook handling and GitHub Actions workflow management.

Capabilities

Module: git.webhook

Receives GitHub webhook events, validates HMAC-SHA256 signatures, normalizes payloads to a common GitEvent schema, and publishes to a configured message broker topic.

modules:
  - name: github-webhooks
    type: git.webhook
    config:
      provider: github
      secret: "${GITHUB_WEBHOOK_SECRET}"
      events: [push, pull_request, release]
      topic: "git.events"

The module registers an HTTP handler at /webhooks/github. Configure your GitHub repository webhook to point to https://<host>/webhooks/github.

Module: github.runner_provider

Provides the GitHub-owned side of the workflow-compute runner provider boundary. It mints general repository- or organization-scoped registration tokens, preflights organization runner labels/groups, creates exact ephemeral JIT runner configurations, and removes runners without exposing GitHub API credentials to workflow-compute.

modules:
  - name: github-runners
    type: github.runner_provider
    config:
      token: "${GITHUB_TOKEN}"
      provider_token: "${GITHUB_RUNNER_PROVIDER_TOKEN}"
      repositories: ["GoCodeAlone/workflow-compute"]
      organizations: ["GoCodeAlone"]
      runner_groups: ["workflow-compute-stg"]
      state_dir: "/var/lib/workflow-github-runner-provider"

For local proof runs, the repo also builds github-runner-provider, a small HTTP provider service:

GITHUB_TOKEN=... \
GITHUB_RUNNER_PROVIDER_TOKEN=... \
GITHUB_RUNNER_PROVIDER_REPOSITORIES=GoCodeAlone/workflow-compute \
GITHUB_RUNNER_PROVIDER_ORGANIZATIONS=GoCodeAlone \
GITHUB_RUNNER_PROVIDER_RUNNER_GROUPS=workflow-compute-stg \
GITHUB_RUNNER_PROVIDER_STATE_DIR=/var/lib/workflow-github-runner-provider \
  bin/github-runner-provider 127.0.0.1:8090

workflow-compute should point at that service with COMPUTE_GITHUB_RUNNER_PROVIDER_URL and COMPUTE_GITHUB_RUNNER_PROVIDER_TOKEN; it should not receive GITHUB_TOKEN. The ephemeral_runner_job operation uses the authenticated JIT endpoint, starts the bundled listener with run.sh --jitconfig, and unregisters only the exact provider-owned JIT runner ID recorded in the ownership journal. Workload outputs are returned through the declared github-workload-outputs.tar.gz provider artifact rather than arbitrary names.

Step: step.gh_action_trigger

Triggers a GitHub Actions workflow via workflow_dispatch.

- type: step.gh_action_trigger
  config:
    owner: "GoCodeAlone"
    repo: "workflow"
    workflow: "ci.yml"
    ref: "main"
    inputs:
      environment: "staging"
    token: "${GITHUB_TOKEN}"
Step: step.gh_action_status

Checks or polls the status of a GitHub Actions workflow run.

- type: step.gh_action_status
  config:
    owner: "GoCodeAlone"
    repo: "workflow"
    run_id: 123456
    token: "${GITHUB_TOKEN}"
    wait: true
    poll_interval: "10s"
    timeout: "30m"
Step: step.gh_upstream_release_monitor

Checks the latest release tag for an upstream GitHub repository and reports whether it differs from the tag your application has pinned. Public repositories can be checked without a token; private repositories or higher-rate checks can provide token.

- name: check_upstream
  type: step.gh_upstream_release_monitor
  config:
    upstream_owner: "{{ .upstream_owner }}"
    upstream_repo: "{{ .upstream_repo }}"
    pinned_tag: "{{ .pinned_tag }}"
    token: "${GITHUB_TOKEN}"

The step is intentionally read-only. Compose update_available with step.conditional, repo-owned update workflows, step.gh_action_trigger, step.gh_action_status, step.gh_pr_create, and step.gh_pr_merge when an application should re-pin an upstream dependency.

Workflow-compute workloads should be routed through a workflow-compute provider or through GitHub's normal self-hosted runner/webhook surfaces. This plugin does not expose workflow-compute gateway client steps or generic check-run creation steps.

Building

make build
# binary at bin/workflow-plugin-github

Testing

make test

Installation

make install DESTDIR=/path/to/workflow

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateEphemeralRunnerJobInput

func ValidateEphemeralRunnerJobInput(input json.RawMessage) error

func ValidateEphemeralRunnerJobOutput

func ValidateEphemeralRunnerJobOutput(output any) error

func ValidateGitHubRunnerProviderConfig

func ValidateGitHubRunnerProviderConfig(config providercontract.Config) error

func ValidateGitHubRunnerProviderConfigValue

func ValidateGitHubRunnerProviderConfigValue(config any) error

Types

This section is empty.

Directories

Path Synopsis
cmd
github-runner-provider command
Command github-runner-provider serves the GitHub-owned runner provider API used by workflow-compute without placing GitHub API credentials in compute.
Command github-runner-provider serves the GitHub-owned runner provider API used by workflow-compute without placing GitHub API credentials in compute.
workflow-plugin-github command
Command workflow-plugin-github is a workflow engine external plugin that provides GitHub integration: webhook handling and GitHub Actions workflow management.
Command workflow-plugin-github is a workflow engine external plugin that provides GitHub integration: webhook handling and GitHub Actions workflow management.
Package internal implements the workflow-plugin-github plugin, providing GitHub webhook handling and GitHub Actions workflow management.
Package internal implements the workflow-plugin-github plugin, providing GitHub webhook handling and GitHub Actions workflow management.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL