Skip to content

Commit

Permalink
feat: update VERSION file in php-yoshi repo if it exists (#2228)
Browse files Browse the repository at this point in the history
* feat: Update VERSION file in php-yoshi repo if it exists

* test fix

* Fix linting

---------

Co-authored-by: Jeff Ching <chingor@google.com>
  • Loading branch information
yash30201 and chingor13 authored Mar 11, 2024
1 parent b12904a commit 378367b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/strategies/php-yoshi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ export class PHPYoshi extends BaseStrategy {
}),
});

// update VERSION file
updates.push({
path: this.addPath('VERSION'),
createIfMissing: false,
updater: new DefaultUpdater({
version,
}),
});

// update the aggregate package information in the root composer.json
updates.push({
path: this.addPath('composer.json'),
Expand Down
1 change: 1 addition & 0 deletions test/strategies/php-yoshi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ describe('PHPYoshi', () => {
const updates = release!.updates;
assertHasUpdate(updates, 'CHANGELOG.md', Changelog);
assertHasUpdate(updates, 'composer.json', RootComposerUpdatePackages);
assertHasUpdate(updates, 'VERSION', DefaultUpdater);
});
it('finds touched components', async () => {
const strategy = new PHPYoshi({
Expand Down

0 comments on commit 378367b

Please sign in to comment.