Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.7.0
v24.12.0
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ outputs:
changelog:
description: A markdown representation of the changes in the new release
runs:
using: 'node20'
using: 'node24'
main: 'dist/index.js'
57 changes: 31 additions & 26 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -18,27 +22,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438));
const semver = __importStar(__nccwpck_require__(1383));
const run = () => __awaiter(void 0, void 0, void 0, function* () {
const run = async () => {
try {
const includePrerelease = parseBoolean(core.getInput('include-prerelease', {
required: false
Expand All @@ -58,7 +63,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
const nwo = process.env['GITHUB_REPOSITORY'] || '/';
const [owner, repo] = nwo.split('/');
core.info(`Listing releases for ${owner}/${repo}`);
const { data: releases } = yield octokit.rest.repos.listReleases({
const { data: releases } = await octokit.rest.repos.listReleases({
owner,
repo
});
Expand All @@ -71,24 +76,24 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
core.error(`Latest release for "${nwo}" could not be found`);
return;
}
const base = (latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag_name) || '';
const base = latestRelease?.tag_name || '';
core.info(`Comparing commits for ${owner}/${repo} on ${base} against ${defaultBranch}`);
const { data: comparison } = yield octokit.rest.repos.compareCommits({
const { data: comparison } = await octokit.rest.repos.compareCommits({
owner,
repo,
base,
head: defaultBranch
});
core.info(`${defaultBranch} is ${comparison.status} by ${comparison.total_commits} commit(s)`);
const lastReleaseDate = (latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.published_at) || '';
const lastReleaseDate = latestRelease?.published_at || '';
core.setOutput('latest-release-date', lastReleaseDate);
core.info(`latest release date is ${lastReleaseDate}`);
core.setOutput('commit-count', comparison.total_commits.toString());
if (!comparison.total_commits) {
core.info('Release is up-to-date');
return;
}
const newTag = semver.inc(latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag_name, 'patch');
const newTag = semver.inc(latestRelease?.tag_name, 'patch');
let newVersion = `v${newTag}`;
if (versionOverride) {
newVersion = versionOverride;
Expand Down Expand Up @@ -119,18 +124,18 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
const changeLog = `## Authors\n\n${authors}\n## Changes\n\n${compareUrl}\n\n${commitSummary}`;
core.setOutput('changelog', changeLog);
core.info(`Creating release ${newVersion} for ${owner}/${repo}`);
yield octokit.rest.repos.createRelease({
await octokit.rest.repos.createRelease({
owner,
repo,
tag_name: newVersion,
tag_name: newVersion, // eslint-disable-line @typescript-eslint/camelcase
name: newVersion,
body: changeLog
});
}
catch (error) {
core.setFailed(`create-release failure: ${error}`);
}
});
};
exports["default"] = run;
function parseBoolean(toParse) {
return !!(toParse && toParse.toLowerCase() === 'true');
Expand Down
43 changes: 29 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@actions/github": "^5.1.1",
"@types/jest": "^29.5.0",
"@types/js-yaml": "3.12.1",
"@types/node": "20.11.1",
"@types/node": "^24.12.0",
"@typescript-eslint/eslint-plugin": "2.3.0",
"@typescript-eslint/parser": "2.3.0",
"@vercel/ncc": "^0.36.1",
Expand All @@ -46,7 +46,7 @@
"nock": "^13.0.2",
"prettier": "2.0.4",
"ts-jest": "^29.1.0",
"typescript": "^4.9.5"
"typescript": "^5.7.2"
},
"bugs": {
"url": "https://github.com/ecobee/create-release/issues"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["ES2022"], /* Specify library files to be included in the compilation. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -897,12 +897,12 @@
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/node@*", "@types/node@20.11.1":
version "20.11.1"
resolved "https://registry.npmjs.org/@types/node/-/node-20.11.1.tgz"
integrity sha512-DsXojJUES2M+FE8CpptJTKpg+r54moV9ZEncPstni1WHFmTcCzeFLnMFfyhCVS8XNOy/OQG+8lVxRLRrVHmV5A==
"@types/node@*", "@types/node@^24.12.0":
version "24.12.0"
resolved "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz"
integrity sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==
dependencies:
undici-types "~5.26.4"
undici-types "~7.16.0"

"@types/parse-json@^4.0.0":
version "4.0.0"
Expand Down Expand Up @@ -4426,20 +4426,20 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.9.5, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", "typescript@>=4.3 <6":
version "4.9.5"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
typescript@^5.7.2, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", "typescript@>=4.3 <6":
version "5.9.3"
resolved "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz"
integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==

uglify-js@^3.1.4:
version "3.19.3"
resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz"
integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==

undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
undici-types@~7.16.0:
version "7.16.0"
resolved "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz"
integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==

undici@^5.25.4:
version "5.29.0"
Expand Down
Loading