mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
ci: Prevent new version patches, if only content is ci changes (#27329)
This commit is contained in:
parent
bab42216c0
commit
24dcf7510a
|
|
@ -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
|
||||
|
|
|
|||
2
.github/scripts/github-helpers.mjs
vendored
2
.github/scripts/github-helpers.mjs
vendored
|
|
@ -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}`]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user