Create GitHub Actions using Python
Project description
PyAction - Create GitHub Actions Using Python! :sparkles:
PyAction helps you to develop GitHub Actions using Python. It's delivered as an installable package with the ability to run and test the action locally before any deployment.
- name: Using the python action
uses: you/your-python-action@v2
with:
name: Jane
age: 20
from pyaction import PyAction
workflow = PyAction()
@workflow.action
def greetings_action(name: str, age: int) -> None:
workflow.write(
{
"phrase": f"Hello {name}. You are {age}!"
}
)
# $ pyaction run
# [
# {
# "var": "phrase",
# "value": "Hello Jane. You are 20!",
# "type": "<class 'str'>",
# "usage": "${{ steps.STEP_ID.outputs.phrase }}"
# }
# ]
Check out the official docs for more detailed information. There is also a Quickstart demo tutorial that walks you through a simple hello-world action.
Installation
Run the following command in a fresh CLI tab.
pip install -U "pyaction[cli]"
To make sure the installation process was successful, run the following command.
pyaction --version
The pyaction
release is made to be super light which will make your workflow run very fast. The pyaction[cli]
that you install on your local machine has some additional packages for local development.
Usage
It's recommended to initialize a template, then going along the development process. Thus, run the init
command.
pyaction init
Answer the prompts and your template will be generated. Check out the docs for the further steps.
Contribution
All your contributions and assistance are welcome. For more information about how you can contribute to the project, please follow the instructions here. :sparkles:
License
PyAction is licensed under the MIT License terms.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyaction-0.8.2.tar.gz
.
File metadata
- Download URL: pyaction-0.8.2.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8523757ab98e7a3a5bb0261567f453d309fc5a93d1ea1af80021a60e7b7504f0 |
|
MD5 | 7cf93def61c5ffd85103a4a91820de1f |
|
BLAKE2b-256 | 2a67faff69bfd073122b888d0cb315053ccca80a522fedd6a5a2e73c2aa97b81 |
File details
Details for the file pyaction-0.8.2-py3-none-any.whl
.
File metadata
- Download URL: pyaction-0.8.2-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7982b1b54078c52debe7f65b7069b1fa636c95218b0891ee3e75a749c10f0bc1 |
|
MD5 | 49be0be009f8f007a6769528fac133af |
|
BLAKE2b-256 | 236700d8b2ac38216d49c8c556ce11fc7861afd47c8cf160591f18e7698007f1 |