Use this template to bootstrap the creation of a Python action. 🚀
This template includes compilation support, tests, a validation workflow, and publishing guidance. There's also a simple template in the Hello world Python action repository.
Click the Use this template button, and provide the details for your action.
-
Create a virtual environment
python3 -m venv .venv source .venv/bin/activate
-
Install the dependencies
pip install -e ".[dev]" pre-commit install
-
Run the tests
$ pytest --cov --cov-report=term-missing -q ..... [100%] --------- coverage: platform <platform>, python <python> ---------- Name Stmts Miss Branch BrPart Cover Missing ------------------------------------------------------------- src/__init__.py 2 0 0 0 100% src/main.py 13 0 0 0 100% src/wait.py 6 0 2 0 100% ------------------------------------------------------------- TOTAL 21 0 2 0 100% 5 passed in 1.20s
The action.yml
file defines metadata for your action. For
details about this file, see
Metadata syntax for GitHub Actions.
If you copied this repository, you should update your action's action.yml
.
GitHub Action is run from GitHub repositories. You can use tag to create a release.
git tag v1 -f --no-sign
git push origin v1 -f
After testing, you can create a v1 tag and make other developers to use the versioned action.
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Test Local Action
id: test-action
uses: actions-python/python-action@v1
with:
milliseconds: 1000