This is a template repository for creating new repositories with pre-configured settings and files commonly used in my Python projects.
This is a hello world template repository for creating new python repositories with pre-configured settings and files commonly used in my projects.
It includes bug and feature issue templates, a pull request (PR) template, CodeQL action, dependabot action, markdown linking & spelling check actions, superlinter (YML & Markdown validation enabled) action, stale issues & PR GitHub actions, and codeowners, changelog, and contributing Markdown files.
-
.github/ISSUE_TEMPLATE/bug.md
: Template for reporting bugs. -
.github/ISSUE_TEMPLATE/feature.md
: Template for suggesting new features. -
.github/PULL_REQUEST_TEMPLATE.md
: Template for creating pull requests. -
.github/workflows/Dockerfile
: Dockerfile to create for HelloWorld Python application. -
.github/workflows/coverage.yaml
: GitHub Actions workflow for Python unit test code coverage. -
.github/workflows/docker-build-push.yml
: GitHub Actions workflow to build and push a Docker image containing the application code to Docker Hub when code is pushed to the main branch. -
.github/workflows/docker-push-readme.yml
: GitHub Actions workflow to push contents of README.md to overview section of image page on Docker Hub when code is pushed to the main branch. -
.github/workflows/greetings.yml
: GitHub Actions workflow for automated Greeting messages. -
.github/workflows/linter.yml
: GitHub Actions workflow for YML & Markdown validation. -
.github/workflows/md-links.yml
: GitHub Actions workflow for Markdown link validation. -
.github/workflows/safety.yml
: GitHub Actions workflow for checking Python dependencies for known security vulnerabilities using the Safety tool. -
.github/workflows/spellcheck.yml
: GitHub Actions workflow for spell checking Markdown. -
.github/workflows/stale.yml
: GitHub Actions workflow for managing stale issues and pull requests. -
.github/workflows/test.yaml
: GitHub Actions workflow for Python unit tests. -
.github/CODEOWNERS
: File to specify code owners for the repository. -
CHANGELOG.md
: File to track changes made to the repository. -
CONTRIBUTING.md
: Guidelines for contributing to the project. -
LICENSE
: MPL 2.0 license file. -
README.md
: This file. -
requirements.txt
: File used to specify the dependencies or external packages required by the project.
python main.py
pytest
Build the Docker image.
docker build -t template-repo-template .
Run the Docker image as a container.
docker run -it template-repo-template
docker pull <dockerhub-username>/template-repo-template:<tag>
Replace with your Docker Hub username and with the specific tag of the Docker image you want to pull.
docker run -it <dockerhub-username>/template-repo-template:<tag>
Replace with your Docker Hub username and with the specific tag of the Docker image you want to pull.
Please review the contents of this repository and customize them to fit your project's specific requirements.
The following changes need to be made:
-
Update GitHub issue URL in
CONTRIBUTING.md
. -
Replace
genai-musings
GitHub organization name inmd-link-check.json
with your GitHub organization name. -
Add any keys / secret files to
.gitignore
. -
Review and update
CHANGELOG.md
. -
Review and update
CODEOWNERS
. -
Enable CodeQL analysis to identify vulnerabilities and errors with CodeQL, when enabling select the option to generate -
.github/codeql.yml
: the GitHub Actions workflow for CodeQL analysis. -
Enable Dependabot alerts, security updates and version updates when enabling it select the option to generate -
.github/dependabot.yml
: the configuration file controlling how Dependabot maintains the repository. Note: Remember to set the ```package-ecosystem`` to pip. -
Enable Bandit when enabling it select the option to generate -
.github/bandit.yml
: the GitHub Actions workflow designed to find common security issues in Python code. -
Enable Secret Scanning with Push Protection to receive alerts on GitHub for detected secrets, keys, or other tokens, and to block commits which contain supported secrets.
-
Add Branch Protection for the main branch.
-
Review and if necessary update
dependabot.yml
to customize Dependabot alerts. -
Replace code in
main.py
with your code, update tests and associated GitHub action workflows accordingly. -
Review and update
README.md
. Remove redundant instructions such as this and update the Badges displayed including their URLs depending on which of the associated workflows you have enabled. -
Review and enable required linters in the
.github/workflows/linter.yml
GitHub action. -
Review and update the project dependencies in
requirements.txt
. -
Review and update the Docker Hub details in
.github/workflows/docker-build-push.yml
. You need to replace , , and with your own values. -
Review and update the maintainer and description entries in the
Dockerfile
. -
Review and update the Docker Hub details in
.github/workflows/docker-push-readme.yml
. You need to replace and . You also need to update theshort_description
for the image.
Note: The username and password for Docker Hub should be stored as secrets in your GitHub repository. To set up the secrets in your GitHub repository, go to your repository page, navigate to the "Settings" tab, and then select "Secrets" from the left menu. Add a secret named DOCKERHUB_USERNAME with your Docker Hub username, and another secret named DOCKERHUB_PASSWORD with your Docker Hub password.
You are now licensed to code. Happy collaborations!