Skip to content

Commit

Permalink
chore(Repo): Add repo to scopes (#5609)
Browse files Browse the repository at this point in the history
This scope is required for global repo-level changes, not directly linked to a single package
  • Loading branch information
SokratisVidros authored May 20, 2024
1 parent d993982 commit 6ae8153
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/conventional-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<<EOF' >> $GITHUB_ENV
echo "$scopes" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
Expand All @@ -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
Expand All @@ -50,21 +54,21 @@ 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 }}
```
# 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "novuhq",
"name": "root",
"private": true,
"packageManager": "[email protected]",
"scripts": {
Expand Down

0 comments on commit 6ae8153

Please sign in to comment.