Skip to content

Template to coding projects that requires a conventional workflow

License

Notifications You must be signed in to change notification settings

mauroalderete/coding-projects-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coding-projects-template

Template to coding projects that requires a conventional workflow

 

✋ Introducing coding-projects-templates

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.

❓ How to use this template

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.

🔥 What to do After Using coding-projects-templates

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

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 in Settings > Actions > General > Workflow Permissions.
  • Add actions secret GH_PROJECT_AUTOMATION in Settings > 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
  • Restrict PR resolving only merging strategy in Settings > General > Pull Request:
    • Allow merge commits
    • Allow squash merging
    • Allow rebase merging
  • Protect you main branch in Settings > 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

Workflows

CodeQL

/.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.

Tests

/.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.

Labeling

/.github/workflows/labeling.yml

Include a PR labeling workflow caller. It consumes the reusable workflows stored in mauroalderete/workflows.

Liberation

/.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

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

Deploy Release

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

/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

/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

/.gitignore

This file is empty. Replace the content with what you think is more convenient.

About

Template to coding projects that requires a conventional workflow

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published