From 6ae81531dad2570e655d73d3f891149f18cef165 Mon Sep 17 00:00:00 2001 From: Sokratis Vidros Date: Mon, 20 May 2024 18:25:53 +0300 Subject: [PATCH] chore(Repo): Add repo to scopes (#5609) This scope is required for global repo-level changes, not directly linked to a single package --- .github/workflows/conventional-commit.yml | 22 +++++++++++++--------- package.json | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/conventional-commit.yml b/.github/workflows/conventional-commit.yml index 4bcf284138b..b01612d0de7 100644 --- a/.github/workflows/conventional-commit.yml +++ b/.github/workflows/conventional-commit.yml @@ -6,11 +6,13 @@ on: - opened - edited - synchronize - pull_request: - types: - - opened - - edited - - synchronize + + # Use the following event if you want edit and test setting regarding conventional commits + # pull_request: + # types: + # - opened + # - edited + # - synchronize permissions: pull-requests: write @@ -29,7 +31,7 @@ jobs: - name: Generate scopes id: generate_scopes run: | - scopes=$(pnpm m ls --json --depth=-1 | grep "name" | cut -d":" -f2 | grep "@novu" | cut -d"/" -f2 | grep "\"" | cut -d"\"" -f1) + scopes=$(pnpm m ls --json --depth=-1 | grep "name" | sed -e 's/.*\: \(.*\)/\1/' -e 's/@novu\///g' -e 's/[",]//g') echo 'SCOPES<> $GITHUB_ENV echo "$scopes" >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV @@ -41,6 +43,8 @@ jobs: with: scopes: | ${{ env.SCOPES }} + requireScope: true + - uses: marocchino/sticky-pull-request-comment@v2 # When the previous steps fails, the workflow would stop. By adding this @@ -50,14 +54,14 @@ jobs: header: pr-title-lint-error message: | Hey there and thank you for opening this pull request! 👋 - + We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. Your PR title is: `${{ github.event.pull_request.title }}` It should be something like: `feat(scope): Add fancy new feature` Details: - + ``` ${{ steps.lint_pr_title.outputs.error_message }} ``` @@ -65,6 +69,6 @@ jobs: # Delete a previous comment when the issue has been resolved - if: ${{ steps.lint_pr_title.outputs.error_message == null }} uses: marocchino/sticky-pull-request-comment@v2 - with: + with: header: pr-title-lint-error delete: true diff --git a/package.json b/package.json index 1dca8f42a04..63f47dcb6aa 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "novuhq", + "name": "root", "private": true, "packageManager": "pnpm@9.1.1", "scripts": {