github-action-utils is a Python library (version 1.1.0) providing a collection of functions to execute GitHub Action Workflow Commands directly from Python scripts within a workflow run. This allows for programmatic control over aspects like setting outputs, saving state, logging, and job summaries. The library aims for a stable release cadence, typically updating to reflect changes in GitHub Actions' underlying command mechanisms.
pip install github-action-utilsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use various utility functions provided by `github-action-utils` within a Python script running as part of a GitHub Action workflow. It covers setting outputs and state, logging messages at different levels, and appending content to the job summary. Outputs and state variables are automatically registered with the GitHub Actions runner.
Upgrade to `github-action-utils>=1.1.0`. Ensure your workflow runners are up-to-date (version 2.298.2 or greater for warnings, and generally updated to avoid failures for direct stdout commands). Users relying on the *old internal behavior* of these functions might need to verify compatibility, though the library aims to provide the correct interface for the new GitHub spec.
Upgrade to `github-action-utils>=1.0.2` to ensure consistent handling of the `use_subprocess` parameter within the `group()` context manager.
If encountering issues with workflow commands not being recognized, try setting `use_subprocess=True` on individual function calls (e.g., `gha_utils.echo("msg", use_subprocess=True)`) or setting the environment variable `COMMANDS_USE_SUBPROCESS=true` for the workflow step.Install the library using pip: `pip install github-action-utils`. Ensure your import statement is `import github_action_utils` or `import github_action_utils as gha_utils`.
Correct the function call to use the accurate name as defined in the library, for example, `gha_utils.set_output(...)` instead of `gha_utils.set_ouptut(...)`.
Ensure all required arguments, such as both `name` and `value` for `set_output`, are passed to the function. Example: `gha_utils.set_output("my_key", "my_value")`.Provide arguments of the correct type as expected by the function. For example, ensure messages for logging functions like `debug`, `warning`, or `error` are strings: `gha_utils.debug("This is a debug message")`.No dependency data recorded yet.