From 8f0293d17bd5c7583cd74fe8ae4eae952e7b25d7 Mon Sep 17 00:00:00 2001 From: gowtham <68599050+ygowthamr@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:45:43 +0530 Subject: [PATCH 1/2] Created PrValidator.yml --- .github/workflows/PrValidator.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/PrValidator.yml diff --git a/.github/workflows/PrValidator.yml b/.github/workflows/PrValidator.yml new file mode 100644 index 00000000..cb8d1d8b --- /dev/null +++ b/.github/workflows/PrValidator.yml @@ -0,0 +1,28 @@ +# PR Validator + +name: PR Description Check + +on: + pull_request: + types: [opened,edited] + +jobs: + validate-pr-description: + runs-on: ubuntu-latest + steps: + - name: Validate PR Description + id: check_description + run: | + if [ -z "${{ github.event.pull_request.body }}" ]; then + echo "::error::Description is missing!" + exit 1 + fi + + - name: Check for issue number or 'Fix #NEW' + id: check_issue_number + run: | + description="${{ github.event.pull_request.body }}" + if [[ ! "$description" =~ (?i)fix #[0-9]+|(?i)fix #NEW ]]; then + echo "::error::PR description must contain an issue number or 'Fix #NEW'" + exit 1 + fi From 82cb2c4953580166c437e6457d2d4131dbd44ea3 Mon Sep 17 00:00:00 2001 From: gowtham <68599050+ygowthamr@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:52:48 +0530 Subject: [PATCH 2/2] Update PrValidator.yml --- .github/workflows/PrValidator.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/PrValidator.yml b/.github/workflows/PrValidator.yml index cb8d1d8b..ecfdb95a 100644 --- a/.github/workflows/PrValidator.yml +++ b/.github/workflows/PrValidator.yml @@ -1,5 +1,3 @@ -# PR Validator - name: PR Description Check on: @@ -17,7 +15,6 @@ jobs: echo "::error::Description is missing!" exit 1 fi - - name: Check for issue number or 'Fix #NEW' id: check_issue_number run: |