Skip to content

Commit 9972df0

Browse files
committed
docs: Update README.md with target_platform input documentation
1 parent 6bdf895 commit 9972df0

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ To use this action in your workflow, add the following step:
2626
| -------------- | -------------------------------------------------- | ------- |
2727
| `release_type` | Select the version bump type (patch, minor, major) | `patch` |
2828
| `git_tag` | Whether to create a Git tag after bump | `true` |
29+
| `target_platform` | Explicitly specify the platform to update (e.g., `node`, `python`). If not provided, the platform will be detected automatically. | `''` |
30+
31+
### Explicit Platform Targeting (`target_platform`)
32+
33+
By default, the action automatically detects the project's platform based on common manifest files (e.g., `package.json` for Node.js, `pyproject.toml` for Python). However, in certain scenarios, such as monorepos or projects with multiple potential manifest files, you might want to explicitly control which platform's version is bumped.
34+
35+
The `target_platform` input allows you to specify the exact platform (e.g., `node`, `python`, `docker`, `go`, `php`, `rust`) you intend to update. When this input is provided, the action will bypass its automatic detection and directly attempt to update the version for the specified platform.
36+
37+
**Example:**
38+
39+
```yaml
40+
- name: Bump Node.js version
41+
uses: taj54/[email protected]
42+
with:
43+
release_type: 'patch'
44+
target_platform: 'node' # Explicitly target Node.js
45+
```
2946

3047
## Outputs
3148

tests/services/updaterService.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('UpdaterService', () => {
3636
mockNodeUpdater.canHandle.mockReturnValue(false);
3737
mockPythonUpdater.canHandle.mockReturnValue(true);
3838

39-
expect(updaterService.detectPlatform()).toBe('python');
39+
expect(updaterService.getPlatform()).toBe('python');
4040
expect(mockNodeUpdater.canHandle).toHaveBeenCalled();
4141
expect(mockPythonUpdater.canHandle).toHaveBeenCalled();
4242
});
@@ -45,8 +45,8 @@ describe('UpdaterService', () => {
4545
mockNodeUpdater.canHandle.mockReturnValue(false);
4646
mockPythonUpdater.canHandle.mockReturnValue(false);
4747

48-
expect(() => updaterService.detectPlatform()).toThrow(PlatformDetectionError);
49-
expect(() => updaterService.detectPlatform()).toThrow('Could not detect platform.');
48+
expect(() => updaterService.getPlatform()).toThrow(PlatformDetectionError);
49+
expect(() => updaterService.getPlatform()).toThrow('Could not detect platform.');
5050
});
5151
});
5252

0 commit comments

Comments
 (0)