From c5d39534f1dd9bf61fabd65ac6430b960f58297e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 04:38:55 +0000 Subject: [PATCH 1/3] feat/fix: Add release-drafter configuration file --- .github/release-drafter.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..5471147d --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,36 @@ +# Configuration for release-drafter action +name: Release Drafter +on: + push: + branches: + - main + - master + pull_request: + types: + - opened + - reopened + - synchronize + - edited + +jobs: + release-drafter: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 14 + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Release Drafter + uses: release-drafter/release-drafter@v5 + with: + config-file: .github/release-drafter.yml From c5dadb25c887699912da63c3c653be863ac57e80 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 04:39:47 +0000 Subject: [PATCH 2/3] feat: Updated scripts/githooks/pre-commit.sh --- scripts/githooks/pre-commit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 9ffeb28f..5185ffe4 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -25,7 +25,7 @@ chmod +x scripts/githooks/pre-commit.sh # ============================================================================== # This is a pre-commit hook that ensures attempts to commit files that are chmod +x scripts/githooks/pre-commit.sh -# are larger than $limit to your _local_ repo fail, with a helpful error message. +# are larger than $limit to your _local_ repo, with a helpful error message. # You can override the default limit of 2MB by supplying the environment variable: # GIT_FILE_SIZE_LIMIT=2000000 git commit -m "test: this commit is allowed file sizes up to 50MB" @@ -105,7 +105,7 @@ if $shouldFail then printMessage "If you really need to commit this file, you can override the size limit by setting the GIT_FILE_SIZE_LIMIT environment variable, e.g. GIT_FILE_SIZE_LIMIT=20000000 for 20MB. Or, commit with the --no-verify switch to skip the check entirely." printError "Commit aborted" - exit 1; + .git diff-index --cached --name-only $against .github/release-drafter.yml fi if [[ ! $local_branch =~ $valid_branch_regex ]] From 4c1fe83687a826672315f91664ae2788e982abcf Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 04:40:40 +0000 Subject: [PATCH 3/3] feat: Updated scripts/githooks/commit-msg.sh --- scripts/githooks/commit-msg.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/githooks/commit-msg.sh b/scripts/githooks/commit-msg.sh index e5c36474..878795f3 100644 --- a/scripts/githooks/commit-msg.sh +++ b/scripts/githooks/commit-msg.sh @@ -19,6 +19,8 @@ # enforce checking for proper commit message format before actual commits. # You may need to make the scripts executable by 'chmod +x .git/hooks/commit-msg'. +. ./.github/release-drafter.yml + # commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint` # go-gitlint --msg-file="$1" @@ -62,7 +64,7 @@ GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint" $GITLINT_DIR \ --msg-file=$1 \ --target='go-gitlint' \ - --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \ + --subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s*(main|master)?\s?.*" \ --subject-maxlen=150 \ --subject-minlen=10 \ --body-regex=".*" \