From e7a668e64eb4bb15678b963c714dc380d1829bbf Mon Sep 17 00:00:00 2001 From: boc-the-git <3479092+boc-the-git@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:41:02 +1000 Subject: [PATCH] feat: Ensure PR title fits convention (#3683) --- .github/pull_request_template.md | 12 +++++- .github/workflows/pull-request-lint.yml | 41 +++++++++++++++++++ .github/workflows/pull-requests.yml | 4 ++ crowdin.yml | 4 ++ .../developers-guide/code-contributions.md | 14 +++---- 5 files changed, 66 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/pull-request-lint.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 114aa16bdab7..8c7d3ded5233 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,12 @@ ## Which issue(s) this PR fixes: @@ -44,7 +52,7 @@ _(REQUIRED)_ diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml new file mode 100644 index 000000000000..7cd1da905b5e --- /dev/null +++ b/.github/workflows/pull-request-lint.yml @@ -0,0 +1,41 @@ +name: Pull Request Linter + +on: + workflow_call: + pull_request: + types: [edited] # This captures the PR title changing + branches: + - mealie-next + +jobs: + validate-title: + name: Validate PR title + runs-on: ubuntu-latest + steps: + # https://github.com/amannn/action-semantic-pull-request + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Configure which types are allowed (newline-delimited). + # Default: https://github.com/commitizen/conventional-commit-types + types: | + fix + feat + docs + chore + # Configure which scopes are allowed (newline-delimited). + # These are regex patterns auto-wrapped in `^ $`. + scopes: | + deps + auto + l10n + # Configure that a scope must always be provided. + requireScope: false + # If the PR contains one of these newline-delimited labels, the + # validation is skipped. If you want to rerun the validation when + # labels change, you might want to use the `labeled` and `unlabeled` + # event triggers in your workflow. + ignoreLabels: | + bot + ignore-semantic-pull-request diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index b7619be8b385..d6d9cfdbe5c9 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -6,6 +6,10 @@ on: - mealie-next jobs: + pull-request-lint: + name: "Lint PR" + uses: ./.github/workflows/pull-request-lint.yml + backend-tests: name: "Backend Server Tests" uses: ./.github/workflows/partial-backend.yml diff --git a/crowdin.yml b/crowdin.yml index 33dfa2906817..16d34a8788dd 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,4 +1,8 @@ preserve_hierarchy: false +pull_request_title: "chore(l10n): New Crowdin updates" +pull_request_labels: [ + "l10n" +] files: - source: /frontend/lang/messages/en-US.json translation: /frontend/lang/messages/%locale%.json diff --git a/docs/docs/contributors/developers-guide/code-contributions.md b/docs/docs/contributors/developers-guide/code-contributions.md index b0a252966366..4acc5a4db47f 100644 --- a/docs/docs/contributors/developers-guide/code-contributions.md +++ b/docs/docs/contributors/developers-guide/code-contributions.md @@ -2,11 +2,11 @@ [Please Join the Discord](https://discord.gg/QuStdQGSGK). We are building a community of developers working on the project. -## We Develop with Github -We use github to host code, to track issues and feature requests, as well as accept pull requests. +## We Develop with GitHub +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. -## We Use [Github Flow](https://docs.github.com/en/get-started/using-github/github-flow), So All Code Changes Happen Through Pull Requests -Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/using-github/github-flow)). We actively welcome your pull requests: +## We Use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow), So All Code Changes Happen Through Pull Requests +Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)). We actively welcome your pull requests: 1. Fork the repo and create your branch from `mealie-next`. 2. Checkout the Discord, the PRs page, or the Projects page to get an idea of what's already being worked on. @@ -14,13 +14,13 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu 4. Once you've got an idea of what changes you want to make, create a draft PR as soon as you can to let us know what you're working on and how we can help! 5. If you've changed APIs, update the documentation. 6. Run tests, including `task py:check`. -6. Issue that pull request! First make a draft PR, make sure that the automated github tests all pass, then mark as ready for review. -7. Be sure to add release notes to the pull request. +7. Issue that pull request! First make a draft PR, make sure that the automated GitHub tests all pass, then mark as ready for review. We follow Conventional Commits syntax; please title your PR as described in the PR template. +8. Be sure to add release notes to the pull request. ## Any contributions you make will be under the AGPL Software License In short, when you submit code changes, your submissions are understood to be under the same [AGPL License](https://choosealicense.com/licenses/agpl-3.0/) that covers the project. Feel free to contact the maintainers if that's a concern. -## Report bugs using Github's [issues](https://github.com/mealie-recipes/mealie/issues) +## Report bugs using GitHub's [issues](https://github.com/mealie-recipes/mealie/issues) We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/mealie-recipes/mealie/issues/new); it's that easy! ## Write bug reports with detail, background, and sample code