Skip to content

Commit

Permalink
ci: standardise conventional commits (#4084)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Elwell <[email protected]>
  • Loading branch information
dabeeeenster and matthewelwell authored Jun 4, 2024
1 parent da3f186 commit d18cfe8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ api:
- changed-files:
- any-glob-to-any-file: api/**

github:
infrastructure:
- changed-files:
- any-glob-to-any-file: .github/**
- any-glob-to-any-file: infrastructure/**
30 changes: 24 additions & 6 deletions .github/workflows/platform-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@ jobs:
name: Validate Conventional Commit title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- name: Check PR Conventional Commit title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: | # mirrors changelog-sections in the /release-please-config.json
fix
feat
fix
infra
ci
docs
chore
build
deps
ci
perf
refactor
style
test
chore
- name: Auto-label PR with Conventional Commit title
uses: bcoe/conventional-release-labels@v1
with:
type_labels: |
{
"feat": "feature",
"fix": "fix",
"infra": "infrastructure",
"ci": "ci-cd",
"docs": "docs",
"deps": "dependencies",
"perf": "performance",
"refactor": "refactor",
"test": "testing",
"chore": "chore"
}
ignored_types: '[]'

run-e2e-tests-1:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions docs/docs/platform/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ suggesting the next steps.
- If your PR involves a lot of commits, squash them using `git rebase -i` as this makes it easier for us to review.
- Keep lines under 80 characters.

### Conventional Commits

Please prefix the title of your PRs with one of the following
[Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) labels. E.g. `feat: My great feature`:

- **feat**: A new feature or improvement to an existing feature
- **fix**: A bug fix
- **infra**: For Infrastructure-as-code type work
- **ci**: Changes to our CI/CD or build setup
- **docs**: Documentation only changes
- **deps**: Updating library dependencies
- **perf**: A code change that improves performance
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **test**: Adding missing tests or correcting existing tests
- **chore**: Changes that don’t really live anywhere else (_please try NOT to use this label if possible_)

## Pre-commit

The application uses pre-commit configuration ( `.pre-commit-config.yaml` ) to run `black`, `flake8` and `isort`
Expand Down
25 changes: 10 additions & 15 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,44 +29,39 @@
"section": "Infrastructure (Flagsmith SaaS Only)"
},
{
"type": "docs",
"hidden": true,
"section": "Docs"
},
{
"type": "chore",
"type": "ci",
"hidden": true,
"section": "Other"
"section": "CI"
},
{
"type": "build",
"type": "docs",
"hidden": true,
"section": "Build"
"section": "Docs"
},
{
"type": "deps",
"hidden": true,
"section": "Dependency Updates"
},
{
"type": "ci",
"type": "perf",
"hidden": true,
"section": "CI"
"section": "Performance Improvements"
},
{
"type": "refactor",
"hidden": true,
"section": "Refactoring"
},
{
"type": "style",
"type": "test",
"hidden": true,
"section": "Code Style"
"section": "Tests"
},
{
"type": "test",
"type": "chore",
"hidden": true,
"section": "Tests"
"section": "Other"
}
]
}

0 comments on commit d18cfe8

Please sign in to comment.