From 927a586ce64530a89bb7a0418cf369387c2b2cbf Mon Sep 17 00:00:00 2001 From: Binoy Patel Date: Thu, 3 Oct 2024 13:55:36 -0400 Subject: [PATCH 1/2] feat: validate PR title for semantic commit --- .github/workflows/pr-validate.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/pr-validate.yml diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml new file mode 100644 index 00000000000..073726a71b7 --- /dev/null +++ b/.github/workflows/pr-validate.yml @@ -0,0 +1,16 @@ +name: "Validate PR" + +on: + pull_request: + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9b373c3d122fdddaf2da2d3f7ba63c5e24dfa804 Mon Sep 17 00:00:00 2001 From: Binoy Patel Date: Tue, 15 Oct 2024 11:20:17 -0400 Subject: [PATCH 2/2] fix(ci): use pull_request_target for PR title validation --- .../workflows/{pr-validate.yml => validate-pr-title.yml} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename .github/workflows/{pr-validate.yml => validate-pr-title.yml} (65%) diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/validate-pr-title.yml similarity index 65% rename from .github/workflows/pr-validate.yml rename to .github/workflows/validate-pr-title.yml index 073726a71b7..855f3094139 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/validate-pr-title.yml @@ -1,7 +1,12 @@ -name: "Validate PR" +name: "Validate PR title" on: - pull_request: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened permissions: pull-requests: read