- drop support for tag SHA as in most cases this information is not available at the moment
- introduce new testcase to verify `DAYS_SINCE` calculation - fix wrong log messages using the `TagInfo` object instead the name - add additional log messages
This commit is contained in:
+6
-2
@@ -80,7 +80,9 @@ export class ReleaseNotes {
|
||||
|
||||
private async getCommitHistory(octokit: Octokit): Promise<DiffInfo> {
|
||||
const {owner, repo, fromTag, toTag, failOnError} = this.options
|
||||
core.info(`ℹ️ Comparing ${owner}/${repo} - '${fromTag}...${toTag}'`)
|
||||
core.info(
|
||||
`ℹ️ Comparing ${owner}/${repo} - '${fromTag.name}...${toTag.name}'`
|
||||
)
|
||||
|
||||
const commitsApi = new Commits(octokit)
|
||||
let diffInfo: DiffInfo
|
||||
@@ -94,7 +96,9 @@ export class ReleaseNotes {
|
||||
return DefaultDiffInfo
|
||||
}
|
||||
if (diffInfo.commitInfo.length === 0) {
|
||||
core.warning(`⚠️ No commits found between - ${fromTag}...${toTag}`)
|
||||
core.warning(
|
||||
`⚠️ No commits found between - ${fromTag.name}...${toTag.name}`
|
||||
)
|
||||
return DefaultDiffInfo
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -81,11 +81,9 @@ export class Tags {
|
||||
RestEndpointMethodTypes['repos']['getReleaseByTag']['response']['data']
|
||||
|
||||
const release: ReleaseInformation = response.data as ReleaseInformation
|
||||
|
||||
tagInfo.date = moment(release.created_at)
|
||||
|
||||
core.info(
|
||||
`ℹ️ Retrieved information about the release associated with ${tagInfo.name} from the GitHub API for ${owner}/${repo}`
|
||||
`ℹ️ Retrieved information about the release associated with ${tagInfo.name} from the GitHub API`
|
||||
)
|
||||
} catch (error) {
|
||||
core.info(
|
||||
@@ -99,6 +97,10 @@ export class Tags {
|
||||
core.info(
|
||||
`ℹ️ Resolved tag creation time (${creationTimeString}) from 'git for-each-ref --format="%(creatordate:rfc)" "refs/tags/${tagInfo.name}`
|
||||
)
|
||||
} else {
|
||||
core.info(
|
||||
`⚠️ Could not retrieve tag creation time via git cli 'git for-each-ref --format="%(creatordate:rfc)" "refs/tags/${tagInfo.name}'`
|
||||
)
|
||||
}
|
||||
}
|
||||
return tagInfo
|
||||
|
||||
@@ -313,19 +313,11 @@ export function fillAdditionalPlaceholders(
|
||||
transformed = transformed.replace(/\${{OWNER}}/g, options.owner)
|
||||
transformed = transformed.replace(/\${{REPO}}/g, options.repo)
|
||||
transformed = transformed.replace(/\${{FROM_TAG}}/g, options.fromTag.name)
|
||||
transformed = transformed.replace(
|
||||
/\${{FROM_TAG_SHA}}/g,
|
||||
options.fromTag.commit || ''
|
||||
)
|
||||
transformed = transformed.replace(
|
||||
/\${{FROM_TAG_DATE}}/g,
|
||||
options.fromTag.date?.toISOString() || ''
|
||||
)
|
||||
transformed = transformed.replace(/\${{TO_TAG}}/g, options.toTag.name)
|
||||
transformed = transformed.replace(
|
||||
/\${{TO_TAG_SHA}}/g,
|
||||
options.toTag.commit || ''
|
||||
)
|
||||
transformed = transformed.replace(
|
||||
/\${{TO_TAG_DATE}}/g,
|
||||
options.toTag.date?.toISOString() || ''
|
||||
|
||||
Reference in New Issue
Block a user