Skip to content

Commit 5ec175e

Browse files
committed
fix(changelog): handle changelog file absence
- Added error handling for missing changelog - Improved changelog update logic - Added FileNotFoundError handling
1 parent 528f2c2 commit 5ec175e

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

dist/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* universal-version-bump v0.10.3
2+
* universal-version-bump v0.10.4
33
* Universal Version Bump
44
*
55
* Description: A GitHub Action to automatically bump versions across any app (Node, Python, PHP, Docker, etc.)
66
* Author: Taj <[email protected]>
77
* Homepage: https://github.com/taj54/universal-version-bump#readme
88
* License: MIT
9-
* Generated on Fri, 29 Aug 2025 18:37:37 GMT
9+
* Generated on Fri, 29 Aug 2025 19:02:47 GMT
1010
*/
1111
require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
1212
/******/ var __webpack_modules__ = ({
@@ -32972,6 +32972,7 @@ var __importStar = (this && this.__importStar) || (function () {
3297232972
Object.defineProperty(exports, "__esModule", ({ value: true }));
3297332973
exports.ChangelogService = void 0;
3297432974
const core = __importStar(__nccwpck_require__(9999));
32975+
const errors_1 = __nccwpck_require__(4830);
3297532976
/**
3297632977
* Service for managing the changelog file.
3297732978
*/
@@ -33019,7 +33020,16 @@ class ChangelogService {
3301933020
*/
3302033021
async updateChangelog(changelogContent) {
3302133022
const changelogPath = this._getChangelogPath();
33022-
const existingChangelog = await this.fileHandler.readFile(changelogPath);
33023+
let existingChangelog;
33024+
try {
33025+
existingChangelog = await this.fileHandler.readFile(changelogPath);
33026+
}
33027+
catch (error) {
33028+
if (error instanceof errors_1.FileNotFoundError) {
33029+
throw new errors_1.FileNotFoundError(`Changelog file not found at ${changelogPath}`);
33030+
}
33031+
throw error;
33032+
}
3302333033
const versionMatch = changelogContent.match(/## v(\d+\.\d+\.\d+)/);
3302433034
if (versionMatch) {
3302533035
const newVersion = versionMatch[0];

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353
"vitest": "^3.2.4",
5454
"yaml": "^2.8.1"
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)