{"id":7895,"library":"actions-toolkit","title":"GitHub Actions Toolkit for Python","description":"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.","status":"maintenance","version":"0.1.15","language":"en","source_language":"en","source_url":"https://github.com/yanglbme/actions-toolkit","tags":["github","actions","toolkit","ci/cd","automation","workflow"],"install":[{"cmd":"pip install actions-toolkit","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"Importing '*' can lead to namespace pollution and make it unclear which functions are from the toolkit.","wrong":"from actions_toolkit.core import *","symbol":"core","correct":"from actions_toolkit import core"}],"quickstart":{"code":"import os\nfrom actions_toolkit import core\n\n# Simulate GitHub Action input 'name'\nos.environ['INPUT_NAME'] = os.environ.get('GITHUB_ACTOR', 'World')\n\ntry:\n    # Get a required input named 'name'\n    name = core.get_input('name', required=True)\n    \n    # Log an informational message\n    core.info(f'Hello, {name}!')\n    \n    # Set an action output named 'greeting'\n    core.set_output('greeting', f'Hello, {name}!')\n    \n    core.info('Action completed successfully.')\nexcept Exception as e:\n    core.set_failed(f'Action failed: {e}')\n","lang":"python","description":"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."},"warnings":[{"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.","message":"The 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.","severity":"breaking","affected_versions":"All versions"},{"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`).","message":"This `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.","severity":"gotcha","affected_versions":"All versions of `actions-toolkit` (0.1.x)"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed in the active environment using `pip install actions-toolkit`.","cause":"The `actions-toolkit` package is not installed or the Python environment running the script does not have access to it.","error":"ModuleNotFoundError: No module named 'actions_toolkit'"},{"fix":"Provide the name of the input as a string, e.g., `core.get_input('my_input_name')`.","cause":"The `get_input` function was called without the required 'name' argument (the name of the input to retrieve).","error":"TypeError: get_input() missing 1 required positional argument: 'name'"},{"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.","cause":"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).","error":"AttributeError: module 'actions_toolkit.core' has no attribute 'some_non_existent_function'"}]}