{"id":15658564,"url":"https://github.com/cicirello/python-github-action-template","last_synced_at":"2025-05-04T08:35:45.895Z","repository":{"id":38212473,"uuid":"305815611","full_name":"cicirello/python-github-action-template","owner":"cicirello","description":"A template repository for GitHub Actions implemented in Python","archived":false,"fork":false,"pushed_at":"2024-11-11T20:54:58.000Z","size":27,"stargazers_count":26,"open_issues_count":0,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T13:19:37.244Z","etag":null,"topics":["docker","github-actions","python","template-repository"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cicirello.png","metadata":{"funding":{"github":"cicirello","patreon":null,"open_collective":null,"ko_fi":"cicirello","tidelift":null,"community_bridge":null,"liberapay":"cicirello","issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-20T19:40:51.000Z","updated_at":"2025-02-08T17:53:44.000Z","dependencies_parsed_at":"2023-12-07T02:08:08.906Z","dependency_job_id":null,"html_url":"https://github.com/cicirello/python-github-action-template","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":0.07499999999999996,"last_synced_commit":"a11fabb6a9882b0efbabb3e7038692656a4ab7b3"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fpython-github-action-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fpython-github-action-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fpython-github-action-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cicirello%2Fpython-github-action-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cicirello","download_url":"https://codeload.github.com/cicirello/python-github-action-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252136073,"owners_count":21700032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","github-actions","python","template-repository"],"created_at":"2024-10-03T13:12:55.717Z","updated_at":"2025-05-03T02:57:23.680Z","avatar_url":"https://github.com/cicirello.png","language":"Python","funding_links":["https://github.com/sponsors/cicirello","https://ko-fi.com/cicirello","https://liberapay.com/cicirello"],"categories":[],"sub_categories":[],"readme":"# python-github-action-template\nA template repository for GitHub Actions implemented in Python.\n\n## Files in This Template\n\n### README.md\n\nObviously, update this to reflect your GitHub Action.\n\n### LICENSE\n\nChoose your license.  This template is licensed under the MIT license,\nso that is what the LICENSE file indicates. If you use this template,\neither keep the MIT license or update to something compatible.\n\n### CHANGELOG.md\n\nIt is a good idea to keep a changelog, so we've provided a template\nof a changelog within this template repository.\n\n### dockerignore\n\nThe `.dockerignore` is set up as an allowlist, initially \nallowing only the `Dockerfile` and the `entrypoint.py`.\nIf you rename `entrypoint.py`, be sure to edit \nthe `.dockerignore` (or likewise, if your GitHub Action\nneeds any additional files while running).\n\n### gitignore\n\nThe `.gitignore` includes Python related things you likely\nwon't want to store in git (update as appropriate).\n\n### Dockerfile\n\nThe `Dockerfile` in this template pulls an image that\nincludes Python, and then sets the entrypoint to `entrypoint.py`.\nIf you rename `entrypoint.py` (or need additional files) then\ndon't forget to edit the `Dockerfile`.\n\nAdditionally, you will need to decide which docker image to start\nwith. There are two that I commonly use that I also maintain,\nboth of which can be pulled from either Docker Hub or the Github Container\nRegistry. Uncomment/comment as appropriate in the Dockerfile\nas desired. Or if you'd rather not pull one of my images, you can \nsee the source repository for the details.  Here are the options\nfound in the Dockerfile comments:\n* An image with Alpine Linux and Python only to keep image small for fast loading: `FROM cicirello/pyaction-lite:3`\n* An image with Alpine Linux, Python, and git, which is also relatively small: `FROM cicirello/pyaction:3`\n* Beginning with version 4, the pyaction image no longer uses Alpine as the \n  base. It now uses python:3-slim, which is built on Debian (the slim version is \n  small but not nearly as small as Alpine), on\n  which we have installed the GitHub CLI : `FROM cicirello/pyaction:4`\n* To pull from the Github Container Registry instead of Docker Hub: `FROM ghcr.io/cicirello/pyaction:4` (and likewise for the other images).\n\nThe source repositories for these images:\n* https://github.com/cicirello/pyaction-lite\n* https://github.com/cicirello/pyaction\n\n### action.yml\n\nEdit the `action.yml` file to define your action's inputs and outputs\n(see examples in the file).\n\n### entrypoint.py\n\nYou can rename this Python file to whatever you want, provided you change\nits name in all other files above that reference it.  The template version\nincludes examples of accessing Action inputs and producing outputs.  Make\nsure it is executable (the one in the template is already executable). If\nyou simply rename the file, it should keep the executable bit set. However,\nif you delete it and replace it with a new file, you'll need to set it\nexecutable.\n\n### tests/tests.py\n\nPython unit test cases could go here.\n\n### tests/integration.py\n\nIdeally, after unit testing the Python functions, methods, \netc (see above), you should also test the action itself.\nThis involves running the action locally in a workflow\nwithin the action's own repository. If the action generates\nany files, or alters any files, then you can add a step\nto run the tests in `tests/integration.py` to validate the\naction's output. Although you don't necessarily need to do\nthis with Python, it may be convenient since Python would\nalready be configured in your workflow. \n\n### .github/dependabot.yml\n\nThe template repository enables GitHub's dependabot for keeping dependencies up to date\n(it generates pull requests when new versions are found).  The template file\nenables dependabot for Docker (since we're using Docker for the GitHub Action),\nand GitHub Actions to keep any workflow dependencies up to date.\n\n### .github/workflows/build.yml\n\nThis workflow runs on pushes and pull requests against the main branch. It\nexecutes all Python unit tests (see tests/tests.py section above). It verifies that\nthe docker image for the GitHub Action builds. It then executes the GitHub Action\nlocally against the action's own repository, as an integration test. Finally, it \nexecutes the tests in `tests/integration.py` (see earlier section) to validate\nany files created or edited by the integration test. You might also add a step\nto the workflow to test that outputs are correct as well. \n\n### .github/workflows/major-release-num.yml\n\nThis workflow maintains a major release tag (e.g., v1 if current release \nis v1.x.y). It runs on each release and either creates the tag (if this is the\nfirst release of a new major release number) or moves it if this is a minor\nor patch level release. __IMPORTANT: You must edit this with your name, etc in\nthe commit and push step.__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicirello%2Fpython-github-action-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcicirello%2Fpython-github-action-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcicirello%2Fpython-github-action-template/lists"}