Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion scripts/githooks/commit-msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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=".*" \
Expand Down
4 changes: 2 additions & 2 deletions scripts/githooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ]]
Expand Down