Skip to main content

export_github_action

Function export_github_action 

Source
pub fn export_github_action(
    session: &Session,
    params: Option<&[Parameter]>,
) -> String
Expand description

Export a session as a GitHub Actions workflow YAML.

Generates a workflow with:

  • Metadata header comments (session name, date, command count)
  • Trigger on push to main
  • Single build job on ubuntu-latest
  • env: block when parameters are provided
  • Checkout step followed by one step per command
  • working-directory on every step
  • Annotations for failed commands (non-zero exit codes)

When params is Some, an env: block is added at job level and commands use $VAR references.

Empty sessions produce a valid workflow with a “No commands recorded” comment.