File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,15 +63,19 @@ jobs:
6363
6464 readarray -t CC <<< "$(
6565 node -e '
66- const msg = process.argv.slice(2).join(" ");
67- const m = msg.match(/^(feat|fix|chore|refactor|ci|test)(?:\(([^)]+)\))?/);
68- console.log((m?.[1]||""));
69- console.log((m?.[2]||""));
70- ' -- "$COMMIT_MESSAGE"
66+ const subject = (process.argv[2] || "").trim();
67+ const re = /^(feat|fix|chore|refactor|ci|test|docs|perf|style|build|ops|release|revert)(?:\(([^\)\r\n]+)\))?(?:!)?:\s/i;
68+ const m = subject.match(re);
69+ const type = (m?.[1] || "").toLowerCase();
70+ const scope = (m?.[2] || "");
71+ console.log(type);
72+ console.log(scope);
73+ ' -- "$COMMIT_SUBJECT"
7174 )"
7275 CC_TYPE="${CC[0]}"
7376 CC_SCOPE="${CC[1]}"
7477
78+
7579
7680 {
7781 echo ' COMMIT_MESSAGE<<EOF'
8488 echo "CC_TYPE=$CC_TYPE"
8589 echo "CC_SCOPE=$CC_SCOPE"
8690 } >> "$GITHUB_ENV"
91+
92+ echo "Subject : $COMMIT_SUBJECT"
93+ echo "CC_TYPE=$CC_TYPE CC_SCOPE=$CC_SCOPE"
8794
8895 - name : Build metrics JSON
8996 run : node scripts/collect-ci.js
You can’t perform that action at this time.
0 commit comments