From fb119b59d9228107bc4abd652b0c5c7f2ec7fe4c Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Thu, 30 Nov 2023 10:48:20 +0100 Subject: [PATCH] Replace with own native check Test it on itself Symlinks dont work Remove symlink Debug description Use perl because we need the negative lookbehind Revise regex regexr.com/7o5js Slurp the whole description --- .github/jira.yml | 17 +++++++++++++++++ .github/mergeable.yml | 13 ------------- .github/workflows/jira-copy.yml | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 .github/jira.yml delete mode 100644 .github/mergeable.yml create mode 100644 .github/workflows/jira-copy.yml diff --git a/.github/jira.yml b/.github/jira.yml new file mode 100644 index 0000000..47e2489 --- /dev/null +++ b/.github/jira.yml @@ -0,0 +1,17 @@ +name: Must include JIRA ticket +on: pull_request + +jobs: + validate-pr: + runs-on: ubuntu-latest + steps: + - name: Validate PR Description + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' + run: | + DESCRIPTION=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") + echo "Pull Request Description: $DESCRIPTION" + if ! echo "$DESCRIPTION" | perl -0777 -ne 'exit 1 if not /[A-Z]{1,10}\d*\-\d+/' + then + echo "Must include JIRA ticket" + exit 1 + fi diff --git a/.github/mergeable.yml b/.github/mergeable.yml deleted file mode 100644 index b69617c..0000000 --- a/.github/mergeable.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 2 -mergeable: - - when: pull_request.* - filter: - - do: author - must_exclude: - regex: 'dependabot' - validate: - - do: description - must_include: - regex: '((?