diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a7db53bb9..d80e8d0f3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "17.4.0" + ".": "17.4.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ad56f40c0..342a0dad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/release-please?activeTab=versions +## [17.4.1](https://github.com/googleapis/release-please/compare/v17.4.0...v17.4.1) (2026-04-08) + + +### Bug Fixes + +* do not attempt to create pull request when no changes detected ([#2722](https://github.com/googleapis/release-please/issues/2722)) ([9ecabc4](https://github.com/googleapis/release-please/commit/9ecabc40a724e1ba64158844fc9b27ee5d6ed0a2)) + ## [17.4.0](https://github.com/googleapis/release-please/compare/v17.3.0...v17.4.0) (2026-04-06) diff --git a/package-lock.json b/package-lock.json index 691a80936..831f3d916 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "release-please", - "version": "17.4.0", + "version": "17.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "release-please", - "version": "17.4.0", + "version": "17.4.1", "license": "Apache-2.0", "dependencies": { "@conventional-commits/parser": "^0.4.1", @@ -3627,9 +3627,9 @@ } }, "node_modules/lodash": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", - "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, "license": "MIT" }, @@ -4781,9 +4781,9 @@ } }, "node_modules/serialize-javascript": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.4.tgz", - "integrity": "sha512-DuGdB+Po43Q5Jxwpzt1lhyFSYKryqoNjQSA9M92tyw0lyHIOur+XCalOUe0KTJpyqzT8+fQ5A0Jf7vCx/NKmIg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.0.5.tgz", + "integrity": "sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==", "dev": true, "license": "BSD-3-Clause", "engines": { diff --git a/package.json b/package.json index a4100f601..cc71ce57c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "release-please", - "version": "17.4.0", + "version": "17.4.1", "description": "generate release PRs based on the conventionalcommits.org spec", "main": "./build/src/index.js", "bin": "./build/src/bin/release-please.js", @@ -103,6 +103,6 @@ }, "overrides": { "tmp": "0.2.5", - "serialize-javascript": "^7.0.4" + "serialize-javascript": "^7.0.5" } } diff --git a/src/github.ts b/src/github.ts index d99e61b16..29f1d52b4 100644 --- a/src/github.ts +++ b/src/github.ts @@ -1169,6 +1169,20 @@ export class GitHub { draft: !!options?.draft, labels: pullRequest.labels, }); + if (prNumber === 0) { + this.logger.warn( + 'no code changes detected, skipping pull request creation' + ); + return { + headBranchName: pullRequest.headBranchName, + baseBranchName: targetBranch, + number: 0, + title: pullRequest.title, + body: pullRequest.body, + labels: pullRequest.labels, + files: [], + }; + } return await this.getPullRequest(prNumber); } ); diff --git a/src/index.ts b/src/index.ts index 5ad9d61d3..ea2347186 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,5 +63,5 @@ export const configSchema = require('../../schemas/config.json'); export const manifestSchema = require('../../schemas/manifest.json'); // x-release-please-start-version -export const VERSION = '17.4.0'; +export const VERSION = '17.4.1'; // x-release-please-end diff --git a/test/github.ts b/test/github.ts index 5bb64d62d..242bf17b8 100644 --- a/test/github.ts +++ b/test/github.ts @@ -1142,6 +1142,33 @@ describe('GitHub', () => { }); }); + describe('createPullRequest', () => { + it('should not call getPullRequest when no code changes detected', async () => { + const createPullRequestStub = sandbox + .stub(codeSuggester, 'createPullRequest') + .resolves(0); + const getPullRequestStub = sandbox.stub(github, 'getPullRequest'); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const pullRequest = await (github as any).createPullRequest( + { + headBranchName: 'release-please--branches--main', + baseBranchName: 'main', + title: 'Release v1.0.0', + body: 'Release body', + labels: ['release-please'], + }, + 'main', + 'commit message', + [] + ); + + expect(pullRequest.number).to.eql(0); + sinon.assert.calledOnce(createPullRequestStub); + sinon.assert.notCalled(getPullRequestStub); + }); + }); + describe('buildChangeSet', () => { it('should merge updates for the same file', async () => { const manifestPath = '.release-please-manifest.json';