@uxf/scripts 11.78.0 → 11.80.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/GitLab.js +18 -8
- package/src/uxf-release/index.js +2 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/src/GitLab.js
CHANGED
|
@@ -33,14 +33,14 @@ async function getAll(url, config) {
|
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
async function loadCommits(from) {
|
|
36
|
+
async function loadCommits(from, ref_name = "master") {
|
|
37
37
|
const commits = [];
|
|
38
38
|
|
|
39
39
|
let nextPage = "1";
|
|
40
40
|
do {
|
|
41
41
|
const response = await axios.get(`/projects/${env.CI_PROJECT_ID}/repository/commits`, {
|
|
42
42
|
params: {
|
|
43
|
-
ref_name
|
|
43
|
+
ref_name,
|
|
44
44
|
since: from ? dayjs(from).toISOString() : undefined,
|
|
45
45
|
per_page: "100",
|
|
46
46
|
page: nextPage,
|
|
@@ -80,20 +80,30 @@ async function findMigrationFiles(commits) {
|
|
|
80
80
|
return migrationList;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
async function getLastTag(tagPrefix = "release-") {
|
|
84
|
-
const
|
|
83
|
+
async function getLastTag(tagPrefix = "release-", ref_name = "master") {
|
|
84
|
+
const { data: commits } = await axios.get(`/projects/${env.CI_PROJECT_ID}/repository/commits`, {
|
|
85
|
+
params: {
|
|
86
|
+
ref_name,
|
|
87
|
+
per_page: "100",
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const commitIds = commits.map((commit) => commit.id);
|
|
92
|
+
|
|
93
|
+
const { data: tags } = await axios.get(`/projects/${env.CI_PROJECT_ID}/repository/tags`, {
|
|
85
94
|
params: { search: `^${tagPrefix}` },
|
|
95
|
+
per_page: "100",
|
|
86
96
|
});
|
|
87
97
|
|
|
88
|
-
const
|
|
98
|
+
const tag = tags.find((tag) => commitIds.includes(tag.commit.id)) ?? null;
|
|
89
99
|
|
|
90
|
-
if (
|
|
100
|
+
if (!tag) {
|
|
91
101
|
console.log("- release tag not found");
|
|
92
102
|
return null;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
console.log(`- last tag: ${
|
|
96
|
-
return
|
|
105
|
+
console.log(`- last tag: ${tag.name}`);
|
|
106
|
+
return tag;
|
|
97
107
|
}
|
|
98
108
|
|
|
99
109
|
async function createRelease(description, tagPrefix = "release-", dryRun = false) {
|
package/src/uxf-release/index.js
CHANGED
|
@@ -93,8 +93,8 @@ function generateMigrationWarning(migrationFiles = []) {
|
|
|
93
93
|
* @param config {{dryRun?: boolean, channel?: string, messageTitle?: string, googleChatWebhook?: string, tagPrefix?: string}}
|
|
94
94
|
*/
|
|
95
95
|
module.exports = async function (config) {
|
|
96
|
-
const lastTag = await GitLab.getLastTag(config.tagPrefix);
|
|
97
|
-
const commits = await GitLab.loadCommits(lastTag ? lastTag.commit.committed_date : null);
|
|
96
|
+
const lastTag = await GitLab.getLastTag(config.tagPrefix, "master");
|
|
97
|
+
const commits = await GitLab.loadCommits(lastTag ? lastTag.commit.committed_date : null, "master");
|
|
98
98
|
const migrationFiles = await GitLab.findMigrationFiles(commits);
|
|
99
99
|
|
|
100
100
|
const migrationWarning = generateMigrationWarning(migrationFiles);
|