Registry / devops / actions-toolkit

actions-toolkit

JSON →
library0.1.15pypypi✓ verified 84d ago

The `actions-toolkit` Python library provides an SDK to simplify the development of GitHub Actions in Python. It offers functionalities for handling inputs, setting outputs, logging, and interacting with the GitHub Actions environment. The current version is 0.1.15, and while functional, it appears to be in maintenance mode with infrequent updates, as more actively developed alternatives like `github-action-toolkit` and `actions-tools` have emerged.

pip install actions-toolkit
INSTALL
IMPORT
SIG · ACTIONS-TOOLKIT
A
actions-toolkit
devopspythonv0.1.15
Install
3.4s avg
Import
597ms
Disk
45MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.15 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.629s · 46MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.4s · import 0.566s · 47MB
45MB installed
● package 45MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

core
from actions_toolkit import core
from actions_toolkit.core import *
Importing '*' can lead to namespace pollution and make it unclear which functions are from the toolkit.

This quickstart demonstrates how to get an input, log information, and set an output using the `actions-toolkit` library. The `os.environ` lines simulate how GitHub Action inputs are typically provided and how `GITHUB_ACTOR` can be used as a default.

import os from actions_toolkit import core # Simulate GitHub Action input 'name' os.environ['INPUT_NAME'] = os.environ.get('GITHUB_ACTOR', 'World') try: # Get a required input named 'name' name = core.get_input('name', required=True) # Log an informational message core.info(f'Hello, {name}!') # Set an action output named 'greeting' core.set_output('greeting', f'Hello, {name}!') core.info('Action completed successfully.') except Exception as e: core.set_failed(f'Action failed: {e}')
Debug
Known issues
breakingThe official GitHub Actions 'toolkit' (JavaScript) has deprecated and is retiring v1-v2 of its cache package and related functionalities within `@actions/cache`. While `actions-toolkit` is a Python library, any action built with it that directly or indirectly relies on older caching mechanisms may fail after March 1, 2025.
fix
Review GitHub Actions workflows using caching. Ensure you are using `actions/cache@v3` or newer, and check for any direct calls to `@actions/cache` in JavaScript-based actions if your Python action interoperates with them. It's recommended to update to `actions/cache@v4` or higher for continued support.
affects: All versions
gotchaThis `actions-toolkit` library (version 0.1.15) appears to be less actively maintained compared to newer, more feature-rich Python toolkits for GitHub Actions. Alternatives like `github-action-toolkit` (different PyPI package, e.g., `pip install github-action-toolkit`) or `actions-tools` offer more recent updates, type safety, and comprehensive features.
fix
For new projects, consider evaluating `github-action-toolkit` or `actions-tools` for better long-term support and a richer API. If migrating, be aware of different import paths and API signatures (`from github_action_toolkit import ...` vs. `from actions_toolkit import core`).
affects: All versions of `actions-toolkit` (0.1.x)
gotchaThe `core.get_input()` function reads environment variables prefixed with `INPUT_`. If an input is marked `required=True` but the corresponding environment variable is not set, it will raise an error, causing the action to fail. This is common during local testing if environment variables are not correctly mocked.
fix
Always ensure required inputs are provided either in the workflow YAML or mocked in your test environment (e.g., `os.environ['INPUT_MY_INPUT'] = 'value'`). Use `required=False` or provide a default value if an input is optional.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'actions_toolkit'
The `actions-toolkit` package is not installed or the Python environment running the script does not have access to it.
fix
Ensure the package is installed in the active environment using `pip install actions-toolkit`.
TypeError: get_input() missing 1 required positional argument: 'name'
The `get_input` function was called without the required 'name' argument (the name of the input to retrieve).
fix
Provide the name of the input as a string, e.g., `core.get_input('my_input_name')`.
AttributeError: module 'actions_toolkit.core' has no attribute 'some_non_existent_function'
Attempting to call a function that does not exist in the `core` module, or using a function name from a different GitHub Actions toolkit (e.g., the JavaScript toolkit or another Python wrapper).
fix
Consult the `actions-toolkit` documentation (or its source on GitHub) to verify available functions and their correct names. If you intended to use a different Python toolkit, adjust your imports and function calls accordingly.
Upgrade
Version history
0.1.15latest on PyPI · released Oct 28, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
1
Resources
actions-toolkit — pip install actions-toolkit · libregistry