ci: Prevent new version patches, if only content is ci changes (#27329)

This commit is contained in:
Matsu 2026-03-20 13:44:57 +02:00 committed by GitHub
parent bab42216c0
commit 24dcf7510a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,4 @@
import {
countCommitsBetweenRefs,
ensureEnvVar,
listCommitsBetweenRefs,
resolveRcBranchForTrack,
@ -25,12 +24,26 @@ function main() {
console.log(`Commits between ${releaseCandidateBranch} and ${currentTag.tag}:`);
console.log(listCommitsBetweenRefs(releaseCandidateBranch, currentTag.tag));
const commitCount = countCommitsBetweenRefs(releaseCandidateBranch, currentTag.tag);
const commitList = listCommitsBetweenRefs(releaseCandidateBranch, currentTag.tag)
.split('\n')
.filter((commit) => commit.trim().length > 0);
const actionableCommitList = filterActionableCommits(commitList);
writeGithubOutput({
const output = {
release_candidate_branch: releaseCandidateBranch,
should_update: commitCount > 0 ? 'true' : 'false',
});
should_update: actionableCommitList.length > 0 ? 'true' : 'false',
};
console.log(output);
writeGithubOutput(output);
}
/**
* @param { string[] } commitList
* */
export function filterActionableCommits(commitList) {
return commitList.filter((commit) => !commit.trimStart().startsWith('ci:'));
}
// only run when executed directly, not when imported by tests

View File

@ -286,7 +286,7 @@ export function listTagsPointingAt(commit) {
* @param {string} to
*/
export function listCommitsBetweenRefs(from, to) {
return sh('git', ['--no-pager', 'log', '--format="- %s (%h)', `${to}..origin/${from}`]);
return sh('git', ['--no-pager', 'log', '--format=%s (%h)', `${to}..origin/${from}`]);
}
/**