Skip to content

Instantly share code, notes, and snippets.

@markgarrigan
Last active July 29, 2025 20:55
Show Gist options
  • Save markgarrigan/f8d3296ee05de643f3a1ec97ea941a6b to your computer and use it in GitHub Desktop.
Save markgarrigan/f8d3296ee05de643f3a1ec97ea941a6b to your computer and use it in GitHub Desktop.
Github Action Interaction

GitHub Actions Requirements: UI Integration

1. UI-Initiated Shutdown Override

  • The UI must have the ability to override (skip) the next scheduled shutdown without modifying the schedule itself.
  • The GitHub Actions must provide a workflow dispatch or endpoint that:
    • Accepts a request from the UI to override the next scheduled shutdown.
    • Ensures the scheduled shutdown does not execute for the upcoming window (but does not affect future scheduled shutdowns).
    • Optionally, clears the override after the scheduled shutdown time has passed (so future shutdowns happen as normal).
    • Returns confirmation of the override action.

2. UI-Initiated Manual Startup (when cluster is stopped)

  • The UI must have the ability to request a manual startup of the cluster if the cluster is currently stopped (i.e., during the scheduled shutdown window).
  • The GitHub Actions must provide a workflow dispatch or endpoint that:
    • Accepts a startup request from the UI.
    • Validates that the request is allowed (e.g., cluster is currently stopped, and it is during the scheduled shutdown period).
    • Returns an error if the request is not allowed (e.g., cluster is already running, or not in a valid window).

3. UI-Initiated Manual Shutdown (with Time Window)

  • The UI must have the ability to request a manual shutdown of the cluster, but only during the scheduled shutdown window (i.e., after the scheduled shutdown time and before the next scheduled startup).
  • The GitHub Actions must provide a workflow dispatch or endpoint that:
    • Accepts a shutdown request from the UI.
    • Validates that the request is within the shutdown window.
    • Returns an error if the request is outside the allowed window.

4. Expose Cron Schedules

  • The GitHub Actions must make the current shutdown and startup cron expressions available for the UI to read.
  • These cron expressions must be accessible via at least one of the following:
    • A configuration file in the repository (e.g., cluster-schedule.json or config.yaml)
    • An action variable or output parameter from a workflow
    • A workflow dispatch (API-triggered) that returns a JSON payload containing the cron expressions

Why this is important

The UI uses these cron expressions to:

  • Calculate and display to the user when the next scheduled shutdown or startup will occur.
  • Determine when to enable or disable shutdown/startup-related actions in the interface.
  • Ensure accurate, up-to-date reflection of the underlying schedule without requiring manual UI code changes if the schedule is updated.

Example output:

{
  "shutdownCron": "0 20 * * 5",
  "startupCron": "0 7 * * 1"
}

Summary for Developer:

  • Allow the UI to override (skip) the next scheduled shutdown, without changing the overall schedule.
  • Allow the UI to request a manual shutdown, but only during the scheduled shutdown window.
  • Allow the UI to request a manual startup, but only when the cluster is stopped (during scheduled downtime).
  • Expose shutdown and startup cron expressions in a way the UI can read (via config file, action variable, or JSON workflow output), because the UI needs these values to accurately control scheduling-related features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment