Template to coding projects that requires a conventional workflow
- ✋ Introducing
coding-projects-templates
- ❓ How to use this template
- 🔥 What to do After Using
coding-projects-templates
- Workflows
- Code of conduct
- License
- Gitignore
This repository template contains the essential elements used in various projects to many stacks.
- Includes workflows to handle labeling, versioning, testing, release and deployment.
- Contains a private license, a basic contributing redaction, and a covenant code of conduct.
- Implements a definition to generate release notes.
- Defines templates to the three issues types (bug, features, help wanted) and a pull request template.
- Additional prepare a dependabot script.
- Schedule a CodeQL Analysis.
- And include CODEOWNERS
Many of the configuration files in this repository are not working yet. Just consist of a sample definition of the configuration. You may adapt these files depending on your objectives. You should pay attention to subsequent indications to know how you do it.
To use this template, click the button Use this template shown in the upper section on root of repository, then create a new repository.
Another way is starting the process of creating a new repository and selecting this template in the upper section.
This template contains many files. A lot of them require special attention.
Once you create a new repo based on this template, probably you would:
- Remove or disable the workflows that you are not planning use yet.
- Update
CODEOWNERS
. - Update the
CODE_OF_CONDUCT
email. - Update
LICENSE
. - Edit the
ISSUE_TEMPLATES
, especially to relink the project reference - Configure
pull_request_template
- Configure dependabot
- Update
README.md
- Replace title
coding-projects-template
for the title in your repo. - Update subtitle
- After edit workflows, update badgets on header section
- After edit ISSUE_TEMPLATES, update links on header section
- Remove sections that talk about template
- Replace title
Note
You can this checklist directly in your first issue to start setup your new repo.
Later, in your repository settings could set some configurations compatible with the mode of work the github workflows included in this template:
- Enable
Allow GitHub Actions to create and approve pull request
inSettings > Actions > General > Workflow Permissions
. - Add actions secret
GH_PROJECT_AUTOMATION
inSettings > Secrets and variables > Actions
with next permissions:- repo
- repo:status
- repo_deployment
- public_repo
- repo:invite
- security_events
- admin:org
- write:org
- read:org
- manage_runners:org
- project
- read:project
- repo
- Restrict PR resolving only merging strategy in
Settings > General > Pull Request
:- Allow merge commits
- Allow squash merging
- Allow rebase merging
- Protect you
main
branch inSettings > Rules > Rulesets
with:- Bypass list:
- Organization admin
- Maintain
- Target
- Default
- Branch rules
- Restrict creations
- Restrict updates
- Restrict deletions
- Require Linear history
- Require deployments to succeed
- Require signed commits recommended enable
- Require a pull request before merging
- Required approvals: 2 labeling workflow add should send an approval
- Dismiss stale pull request approvals when new commits are pushed
- Require review from Code Owners
- Require approval of the most recent reviewable push
- Require conversation resolution before merging
- Require status checks to pass
- Require branches to be up to date before merging
- Do not require status checks on creation
- Status checks that are required
- Unit tests
- call-labeling-workflow / Assign and test labels from conventional-commits
- Block force pushes
- Require code scanning results
- Bypass list:
/.github/workflows/codeql-analysis.yml
This file enables the CodeQL service provided by GitHub. You should provide a language supported. If your project is not supported, I recommend removing this yaml file.
/.github/workflows/tests.yml
This workflow is the most complex to configure. This depends highly on your stack and environment. In some cases, you will probably need to split this workflow into unit and integration tests. It only contains some steps with a simple message showing you the commands to configure a node test environment.
I recommend you study your case carefully.
/.github/workflows/labeling.yml
Include a PR labeling workflow caller. It consumes the reusable workflows stored in mauroalderete/workflows.
/.github/workflows/liberation.yml
The versioning workflow contains a caller to the reusable workflow stored in mauroalderete/workflows.
The liberation
include a simple versioning and release without adds other artifacts. Is ideal to start, but in the most uses cases you would create your unique liberation flow.
We recommend you look how the reusable liberation workflow works. You can find two reusable workflows that allows configure your liberation resources easily.
project-automation
consists in a simple workflow caller job to run mauroalderete/workflows.
For this workflows works correctly you need configure the secret GH_PROJECT_AUTOMATION
with a PAT token in classic mode.
The PAT token must have permissions for:
- repo
- repo:status
- repo_deployment
- public_repo
- repo:invite
- security_events
- admin:org
- write:org
- read:org
- manage_runners:org
- project
- read:project
This workflows is a simple demo of how setup a simple deploy release when a new release is published by liberation
workflow.
For deploy-release
was triggered is needed that liberation
runs with a github token different that secrets.GITHUB_TOKEN
.
/CODE_OF_CONDUCT.md
This code is based on the covenant code. He is only required to specify an email address to the community to send his messages. Now, this email is [email protected].
/LICENSE
This license is a private personal license redacted by chatGPT. This is only an example. I recommend changing this license to other than to be attached better to your needs. You can replace it with any Open License offered by GitHub, too.
/.gitignore
This file is empty. Replace the content with what you think is more convenient.