From 082781511c615ffb5fe0205c1b69ed2d2f79497c Mon Sep 17 00:00:00 2001 From: LinZhihao-723 Date: Sat, 30 Nov 2024 19:56:51 -0500 Subject: [PATCH] Add conventional commit PR title check --- .github/PULL_REQUEST_TEMPLATE.md | 9 +++++++-- .github/workflows/pr-title-checks.yaml | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pr-title-checks.yaml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9672f6d..d965596 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,10 @@ -# References - + # Description diff --git a/.github/workflows/pr-title-checks.yaml b/.github/workflows/pr-title-checks.yaml new file mode 100644 index 0000000..6cfb301 --- /dev/null +++ b/.github/workflows/pr-title-checks.yaml @@ -0,0 +1,23 @@ +name: "pr-title-checks" + +on: + pull_request_target: + types: ["edited", "opened", "reopened"] + branches: ["main"] + +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + + # Cancel in-progress jobs for efficiency + cancel-in-progress: true + +jobs: + conventional-commits: + permissions: + # For amannn/action-semantic-pull-request + pull-requests: "read" + runs-on: "ubuntu-latest" + steps: + - uses: "amannn/action-semantic-pull-request@v5" + env: + GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"