From 20941ab62d0e1f6225f39cc763fae207cfe935ae Mon Sep 17 00:00:00 2001 From: Holly Gong <39108850+hogo6002@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:16:25 +1000 Subject: [PATCH] chore: add PR title check to follow Git commit convention (#2529) Enforces PR naming to follow with the Git [commit convention](https://www.conventionalcommits.org/en/v1.0.0/) - Uses https://github.com/amannn/action-semantic-pull-request to check - Fails to comply will result in the PR title check failing: ![image](https://github.com/user-attachments/assets/2c9da64b-b1a4-4347-9bd0-2ba5183498ec) --- .github/workflows/pr-check.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/pr-check.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 00000000000..9e8ae6c231e --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: OSV PR format check + +on: + # `pull_request_target` is only required when editing PRs from forks. + pull_request: + types: + - opened + - edited + - reopened + +permissions: + pull-requests: read + +jobs: + title-check: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file