Skip to content

Commit edb2f72

Browse files
Merge pull request product-os#1488 from product-os/kyle/no-previous-tag
Fallback to the base ref if the previous tag cannot be found
2 parents 19f1243 + dc8866c commit edb2f72

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/flowzone.yml

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowzone.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,17 +1509,18 @@ jobs:
15091509
15101510
// Get the previous version tag
15111511
const previousTag = filteredTags.find(tag => tag.name.match(/^v\d+\.\d+\.\d+/));
1512+
const head = context.payload.pull_request?.head.sha || context.sha;
1513+
let base;
15121514
15131515
if (!previousTag) {
1514-
core.setFailed('No previous version tag found');
1516+
const baseRef = context.payload.pull_request?.base.ref;
1517+
core.warning(`No previous version tag found, using ${baseRef}`);
1518+
base = baseRef;
1519+
} else {
1520+
core.info(`Found previous versioned tag: ${previousTag.name}`);
1521+
base = previousTag.name;
15151522
}
15161523
1517-
console.log('previousTag:', JSON.stringify(previousTag, null, 2));
1518-
core.setOutput('previousTag', previousTag);
1519-
1520-
const base = previousTag.name;
1521-
const head = context.payload.pull_request?.head.sha || context.sha;
1522-
15231524
// Get commit history between previous tag and current commit
15241525
const { data: { commits } } = await github.rest.repos.compareCommitsWithBasehead({
15251526
...context.repo,

0 commit comments

Comments
 (0)