Skip to main content

Create GitHub Actions using Python

Project description

PyAction - Create GitHub Actions Using Python! :sparkles: download rate

Version) Python Versions Package Testing Docs CI

PyAction helps you to develop GitHub Actions using Python. It's delivered as an installable package with the ability to 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()

@workflow.action()
def greetings_action(name: str, age: int) -> None:
    workflow.write(
        {
            "phrase": f"Hello {name}. You are {age}!"
        }
    )

# $ pyaction run
# ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ Variable ┃          Value          ┃     Type      ┃           Workflow Usage            ┃
# ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
# │  phrase  │ Hello Jane. You are 20! │ <class 'str'> │ ${{ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaction-0.7.3.tar.gz (389.0 kB view details)

Uploaded Source

Built Distribution

pyaction-0.7.3-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file pyaction-0.7.3.tar.gz.

File metadata

  • Download URL: pyaction-0.7.3.tar.gz
  • Upload date:
  • Size: 389.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyaction-0.7.3.tar.gz
Algorithm Hash digest
SHA256 8e79490e5c833045f7fd718e9811571cc078f071816865d665a76ec8ae5fbeb6
MD5 ddffd8ac84a1f0e46d1f0cd5cd794b32
BLAKE2b-256 5f044e84199f6657c6395000e9ea7d531d9504a5b15b6a8c5aebf6d56d4c10f8

See more details on using hashes here.

File details

Details for the file pyaction-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: pyaction-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyaction-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe6e9cdfb40863d7f74f5b02a701f780b676500b1a0a81be9c2f622cf9ecde61
MD5 99081436aea233900e03eb0b59ed2ff8
BLAKE2b-256 d28019dc7093bb4d79e301b4b81608b6f833fbb7a692c7e7dd93640900d9f0a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page