Skip to content
Snippets Groups Projects
Unverified Commit 94ac40e6 authored by Mahatthana (Kelvin) Nomsawadi's avatar Mahatthana (Kelvin) Nomsawadi Committed by GitHub
Browse files

ci(sdk): Fix some backports aren't included in the changelog (#49926)

parent 70ea4a0a
No related branches found
No related tags found
No related merge requests found
// eslint-disable-next-line import/no-commonjs
module.exports = {
gitRawCommitsOpts: { grep: "(sdk)" },
gitRawCommitsOpts: {
grep: "(sdk)",
},
options: {
preset: "angular",
pkg: {
path: "enterprise/frontend/src/embedding-sdk/package.template.json",
},
tagPrefix: "embedding-sdk-",
transform: function (commit, cb) {
if (typeof commit.gitTags === "string") {
const tagPrefix = "embedding-sdk-";
const rtag = new RegExp(`tag:\\s*[=]?${tagPrefix}(.+?)[,)]`, "gi");
const match = rtag.exec(commit.gitTags);
rtag.lastIndex = 0;
if (match) {
commit.version = match[1];
}
}
if (commit.committerDate) {
const dateFormatter = Intl.DateTimeFormat("sv-SE", {
timeZone: "UTC",
});
commit.committerDate = dateFormatter.format(
new Date(commit.committerDate),
);
}
if (hasBackportPrefix(commit)) {
const { groups } =
/\"(?<type>\w*)(?:\((?<scope>[\w\$\.\-\* ]*)\))?\: (?<message1>.*)\"(?<message2>.*)$/.exec(
commit.header,
);
commit = {
...commit,
type: groups.type,
scope: groups.scope,
subject: groups.message1 + groups.message2,
};
}
cb(null, commit);
},
},
};
function hasBackportPrefix(commit) {
return commit.header.startsWith("🤖 backported");
}
......@@ -387,7 +387,7 @@
"docs-lint-links": "find docs -type f -name '*.md' -print0 | xargs -0 markdown-link-check --quiet --config .mlc_config.json",
"embedding-sdk:fixup-types-imports": "node ./bin/embedding-sdk/fixup-types-after-compilation.js",
"embedding-sdk:generate-package": "node ./bin/embedding-sdk/generate-sdk-package-files.js",
"embedding-sdk:generate-changelog": "yarn conventional-changelog -p angular --pkg enterprise/frontend/src/embedding-sdk/package.template.json --config enterprise/frontend/src/embedding-sdk/conventional-changelog-config.js --tagPrefix embedding-sdk-",
"embedding-sdk:generate-changelog": "yarn conventional-changelog --config enterprise/frontend/src/embedding-sdk/conventional-changelog-config.js",
"embedding-sdk:publish": "cd ./resources/embedding-sdk && npm publish",
"embedding-sdk:test-unit": "yarn test-unit enterprise/frontend/src/embedding-sdk/",
"embedding-sdk:tsc": "tsc --project tsconfig.sdk.json",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment