https://github.com/lnxpy/pyaction
:octocat: Create GitHub Actions Using Python
https://github.com/lnxpy/pyaction
actions automation cicd cli custom-actions docker docker-action github-actions github-ci python
Last synced: 27 days ago
JSON representation
:octocat: Create GitHub Actions Using Python
- Host: GitHub
- URL: https://github.com/lnxpy/pyaction
- Owner: lnxpy
- License: mit
- Created: 2023-07-25T18:17:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T20:54:33.000Z (6 months ago)
- Last Synced: 2024-10-29T23:19:34.295Z (6 months ago)
- Topics: actions, automation, cicd, cli, custom-actions, docker, docker-action, github-actions, github-ci, python
- Language: Python
- Homepage: https://pyaction.imsadra.me/
- Size: 3.1 MB
- Stars: 98
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
Awesome Lists containing this project
README
## PyAction - Create GitHub Actions Using Python! :sparkles: 
[](https://pyaction.imsadra.me/docs/more/marketplace) 
 [
](https://github.com/lnxpy/pyaction/actions/workflows/testing.yml)PyAction helps you to develop [GitHub Actions](https://docs.github.com/en/actions) using Python. It's delivered as an installable package with the ability to run and test the action locally before any deployment.
```yml
- name: Using the python action
uses: you/your-python-action@v2
with:
name: Jane
age: 20
``````python
from pyaction import PyActionworkflow = 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": "",
# "usage": "${{ steps.STEP_ID.outputs.phrase }}"
# }
# ]
```Check out the [official docs](https://pyaction.imsadra.me/docs) for more detailed information. There is also a [Quickstart](https://pyaction.imsadra.me/docs/overview/quickstart) demo tutorial that walks you through a simple hello-world action.
### Installation
Run the following command in a fresh CLI tab.```sh
pip install -U "pyaction[cli]"
```To make sure the installation process was successful, run the following command.
```sh
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.```sh
pyaction init
```Answer the prompts and your template will be generated. Check out the [docs](https://pyaction.imsadra.me/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](https://pyaction.imsadra.me/docs/more/contributing). :sparkles:### License
PyAction is licensed under the [MIT License](LICENSE) terms.