Skip to content

Commit aaf2f56

Browse files
committed
feat: Add target_path input to action
Adds a new 'target_path' input to the GitHub Action, allowing users to specify a subdirectory where version bumping operations should be performed. This enhances flexibility by enabling the action to operate on projects not located at the repository root. - Updated `action.yml` to include the `target_path` input. - Added `TARGET_PATH` constant in `src/config/index.ts` to read the input. - Modified `src/index.ts` to change the current working directory to `TARGET_PATH` at the start of the action execution.
1 parent 9933ad8 commit aaf2f56

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ All notable changes for each version of the Ambient Music extension.
3535
### Fixed
3636

3737
- Corrected NodeUpdater tests by ensuring manifestPath is set.
38-
38+
3939
## v0.7.3 2025 08 24
4040

4141
### Changed
@@ -255,4 +255,4 @@ All notable changes for each version of the Ambient Music extension.
255255
- CI: Keep the versions up-to-date.
256256
- Updated.
257257
- Build: Update build script.
258-
- Updated readme.
258+
- Updated readme.

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
description: 'Explicitly specify the platform to update (e.g., node, python). If not provided, the platform will be detected automatically.'
1919
required: false
2020
default: ''
21+
target_path:
22+
description: 'The target path where the version bump should be applied. If not provided, the action will run in the root directory.'
23+
required: false
24+
default: '.'
2125

2226
outputs:
2327
new_version:

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28387,11 +28387,12 @@ var __importStar = (this && this.__importStar) || (function () {
2838728387
};
2838828388
})();
2838928389
Object.defineProperty(exports, "__esModule", ({ value: true }));
28390-
exports.GIT_TAG = exports.TARGET_PLATFORM = exports.RELEASE_TYPE = void 0;
28390+
exports.TARGET_PATH = exports.GIT_TAG = exports.TARGET_PLATFORM = exports.RELEASE_TYPE = void 0;
2839128391
const core = __importStar(__nccwpck_require__(9999));
2839228392
exports.RELEASE_TYPE = (core.getInput('release_type') || 'patch');
2839328393
exports.TARGET_PLATFORM = core.getInput('target_platform');
2839428394
exports.GIT_TAG = core.getInput('git_tag') === 'true';
28395+
exports.TARGET_PATH = core.getInput('target_path') || '.';
2839528396

2839628397

2839728398
/***/ }),
@@ -28482,6 +28483,7 @@ const config_1 = __nccwpck_require__(5496);
2848228483
const core = __importStar(__nccwpck_require__(9999));
2848328484
async function run() {
2848428485
try {
28486+
process.chdir(config_1.TARGET_PATH);
2848528487
const releaseType = config_1.RELEASE_TYPE;
2848628488
const targetPlatform = config_1.TARGET_PLATFORM;
2848728489
const updaterRegistry = new registry_1.UpdaterRegistry();

src/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ import semver from 'semver';
44
export const RELEASE_TYPE = (core.getInput('release_type') || 'patch') as semver.ReleaseType;
55
export const TARGET_PLATFORM = core.getInput('target_platform');
66
export const GIT_TAG = core.getInput('git_tag') === 'true';
7+
export const TARGET_PATH = core.getInput('target_path') || '.';

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import {
1414
FileNotFoundError,
1515
InvalidManifestError,
1616
} from './errors';
17-
import { RELEASE_TYPE, TARGET_PLATFORM, GIT_TAG } from './config';
17+
import { RELEASE_TYPE, TARGET_PLATFORM, GIT_TAG, TARGET_PATH } from './config';
1818
import * as core from '@actions/core';
1919

2020
async function run() {
2121
try {
22+
process.chdir(TARGET_PATH);
2223
const releaseType = RELEASE_TYPE;
2324
const targetPlatform = TARGET_PLATFORM;
2425

0 commit comments

Comments
 (0)