Template repo to quickly make a tested and documented GitHub action in Python with Poetry

Overview

Python + Poetry GitHub Action Template

Getting started from the template

  1. Rename the src/action_python_poetry package.
  2. Globally replace instances of action-python-poetry and action_python_poetry with your project and package name.
  3. If your repo is private, set it up on CodeCov and add a codecov token to your repo under the CODECOV_TOKEN secret.
  4. Create and test your action. __main__.py in your package will be executed when the action is run. The environment variables your tests use can be set in pyproject.toml and/or managed in test fixtures.
  5. Update action.yml, README.md, and .github/workflows/test-action.yml to reflect your action's specification.
  6. Update LICENSE.md as appropriate, making sure to retain the original copyright and permissions notices in your distribution according to the MIT license that this template is distributed under.
  7. Remove this section from README.md.
  8. Happy hacking!

Like this template?

"Buy Me A Coffee"

Quickstart

name: Run Action
on:
  workflow_dispatch:

jobs:
  action-python-poetry:
    runs-on: ubuntu-latest
    steps:
      - uses: k2bd/[email protected]
        with:
          helloName: k2bd
          repeats: 3

Action Specification

helloName

Required

The name of the person to say hello to

repeats

Optional - default 1

Number of times to say hello to this person

Developing

Install Poetry and poetry install the project

Useful Commands

Note: if Poetry is managing a virtual environment for you, you may need to use poetry run poe instead of poe

  • poe autoformat - Autoformat code
  • poe lint - Linting
  • poe test - Run Tests

Testing the action

The action can be tested locally by building the Dockerfile, e.g.

docker run -e INPUT_HELLONAME=k2bd -e INPUT_REPEATS=2 $(docker build -q .)

Additionally, there is a manual invocation action on the repo called "Test Action" that can be used to invoke the repo's version of the action from the Actions tab of the repo.

Releasing

Release a new version by creating a new annotated semver tag e.g. git tag -a v1.2.3 -m "Release version 1.2.3" and pushing it (git push --tags). Then create a new release from that tag in GitHub.

There is an autoversioning action that keeps major version tags (v1, v2, ...) and latest up-to-date when a new release is published.

Owner
Kevin Duff
Scientific Software Developer
Kevin Duff
My solutions to the Advent of Code 2021 problems in Go and Python 🎄

🎄 Advent of Code 2021 🎄 Summary Advent of Code is an annual Advent calendar of programming puzzles. This year I am doing it in Go and Python. Runnin

Orfeas Antoniou 16 Jun 16, 2022
Yu-Gi-Oh! Master Duel translation script

Yu-Gi-Oh! Master Duel translation script

715 Jan 08, 2023
Bring RGB to life in Neovim

Bring RGB to life in Neovim Change your RGB devices' color depending on Neovim's mode. Fast and asynchronous plugin to live your vim-life to the fulle

Antoine 40 Oct 27, 2022
Second version of SQL-PYTHON-Practicas

SQLite-Python Acerca de | Autor Sobre el repositorio Segunda version de SQL-PYTHON-Practicas 💻 Tecnologias Visual Studio Code Python SQLite3 📖 Requi

1 Jan 06, 2022
Toolchain for project structure and documents optimisation

ritocco Toolchain for project structure and documents optimisation

Harvey Wu 1 Jan 12, 2022
Documentation and issues for Pylance - Fast, feature-rich language support for Python

Documentation and issues for Pylance - Fast, feature-rich language support for Python

Microsoft 1.5k Dec 29, 2022
Convert excel xlsx file's table to csv file, A GUI application on top of python/pyqt and other opensource softwares.

Convert excel xlsx file's table to csv file, A GUI application on top of python/pyqt and other opensource softwares.

David A 0 Jan 20, 2022
Python-samples - This project is to help someone need some practices when learning python language

Python-samples - This project is to help someone need some practices when learning python language

Gui Chen 0 Feb 14, 2022
This tutorial will guide you through the process of self-hosting Polygon

Hosting guide This tutorial will guide you through the process of self-hosting Polygon Before starting Make sure you have the following tools installe

Polygon 2 Jan 31, 2022
xeuledoc - Fetch information about a public Google document.

xeuledoc - Fetch information about a public Google document.

Malfrats Industries 651 Dec 27, 2022
Course Materials for Math 340

UBC Math 340 Materials This repository aims to be the one repository for which you can find everything you about Math 340. Lecture Notes Lecture Notes

2 Nov 25, 2021
Some custom tweaks to the results produced by pytkdocs.

pytkdocs_tweaks Some custom tweaks for pytkdocs. For use as part of the documentation-generation-for-Python stack that comprises mkdocs, mkdocs-materi

Patrick Kidger 4 Nov 24, 2022
Collections of Beautiful Latex Snippets

HandyLatex Collections of Beautiful Latex Snippets Table 👉 Succinct table with bold separation line and gray text %################## Dependencies ##

Xintao 15 Apr 11, 2022
Compare two CSV files for differences. Colorize the differences and align the columns.

pretty-csv-diff Compare two CSV files for differences. Colorize the differences and align the columns. Command-Line Example Command-Line Usage usage:

Devon 6 Dec 29, 2022
A collection of simple python mini projects to enhance your python skills

A collection of simple python mini projects to enhance your python skills

PYTHON WORLD 12.1k Jan 05, 2023
Credit EDA Case Study Using Python

This case study aims to identify patterns which indicate if a client has difficulty paying their installments which may be used for taking actions such as denying the loan, reducing the amount of loa

Purvi Padliya 1 Jan 14, 2022
PyPresent - create slide presentations from notes

PyPresent Create slide presentations from notes Add some formatting to text file

1 Jan 06, 2022
Type hints support for the Sphinx autodoc extension

sphinx-autodoc-typehints This extension allows you to use Python 3 annotations for documenting acceptable argument types and return value types of fun

Alex Grönholm 462 Dec 29, 2022
This program has been coded to allow the user to rename all the files in the entered folder.

Bulk_File_Renamer This program has been coded to allow the user to rename all the files in the entered folder. The only required package is "termcolor

1 Jan 06, 2022
Pydocstringformatter - A tool to automatically format Python docstrings that tries to follow recommendations from PEP 8 and PEP 257.

Pydocstringformatter A tool to automatically format Python docstrings that tries to follow recommendations from PEP 8 and PEP 257. See What it does fo

Daniël van Noord 31 Dec 29, 2022