diff --git a/src/commits.ts b/src/commits.ts index e63d33c..274f681 100755 --- a/src/commits.ts +++ b/src/commits.ts @@ -54,7 +54,9 @@ export class Commits { compareHead = `${commits[0].sha}^` } - core.info(`ℹ️ Found ${commits.length} commits from the GitHub API for ${owner}/${repo}`) + core.info( + `ℹ️ Found ${commits.length} commits from the GitHub API for ${owner}/${repo}` + ) return commits.map(commit => ({ sha: commit.sha, summary: commit.commit.message.split('\n')[0], diff --git a/src/gitHelper.ts b/src/gitHelper.ts index 9ccf162..312560c 100644 --- a/src/gitHelper.ts +++ b/src/gitHelper.ts @@ -1,7 +1,6 @@ import * as exec from '@actions/exec' -import * as fs from 'fs' import * as io from '@actions/io' -import { directoryExistsSync } from './utils'; +import {directoryExistsSync} from './utils' export async function createCommandManager( workingDirectory: string diff --git a/src/main.ts b/src/main.ts index 9c1dc21..6968453 100644 --- a/src/main.ts +++ b/src/main.ts @@ -30,7 +30,9 @@ async function run(): Promise { core.debug(`configurationPath = '${configurationPath}'`) const providedConfiguration = readConfiguration(configurationPath) if (!providedConfiguration) { - core.info(`⚠️ Configuration provided, but it couldn't be found, or failed to parse. Fallback to Defaults`) + core.info( + `⚠️ Configuration provided, but it couldn't be found, or failed to parse. Fallback to Defaults` + ) } else { configuration = providedConfiguration } diff --git a/src/pullRequests.ts b/src/pullRequests.ts index 5ea245f..6310228 100755 --- a/src/pullRequests.ts +++ b/src/pullRequests.ts @@ -55,7 +55,9 @@ export class PullRequests { }) } } catch (e) { - core.warning(`⚠️ Cannot find PR ${owner}/${repo}#${prNumber} - ${e.message}`) + core.warning( + `⚠️ Cannot find PR ${owner}/${repo}#${prNumber} - ${e.message}` + ) return null } } diff --git a/src/releaseNotes.ts b/src/releaseNotes.ts index 37bda98..8665d4f 100755 --- a/src/releaseNotes.ts +++ b/src/releaseNotes.ts @@ -58,7 +58,7 @@ export class ReleaseNotes { return configuration.empty_template ?? DefaultConfiguration.empty_template } - core.startGroup("📦 Build changelog") + core.startGroup('📦 Build changelog') const resultChangelog = buildChangelog(mergedPullRequests, configuration) core.endGroup() return resultChangelog @@ -97,7 +97,9 @@ export class ReleaseNotes { fromDate = maxFromDate } - core.info(`ℹ️ Fetching PRs between dates ${fromDate.toISOString()} to ${toDate.toISOString()} for ${owner}/${repo}`) + core.info( + `ℹ️ Fetching PRs between dates ${fromDate.toISOString()} to ${toDate.toISOString()} for ${owner}/${repo}` + ) const pullRequestsApi = new PullRequests(octokit) const pullRequests = await pullRequestsApi.getBetweenDates( @@ -108,14 +110,19 @@ export class ReleaseNotes { configuration.max_pull_requests ?? DefaultConfiguration.max_pull_requests ) - core.info(`ℹ️ Retrieved ${pullRequests.length} merged PRs for ${owner}/${repo}`) + core.info( + `ℹ️ Retrieved ${pullRequests.length} merged PRs for ${owner}/${repo}` + ) const prCommits = pullRequestsApi.filterCommits( commits, - configuration.exclude_merge_branches ?? DefaultConfiguration.exclude_merge_branches + configuration.exclude_merge_branches ?? + DefaultConfiguration.exclude_merge_branches ) - core.info(`ℹ️ Retrieved ${prCommits.length} PR merge commits for ${owner}/${repo}`) + core.info( + `ℹ️ Retrieved ${prCommits.length} PR merge commits for ${owner}/${repo}` + ) const filteredPullRequests = [] const pullRequestsByNumber: {[key: number]: PullRequestInfo} = {} diff --git a/src/tags.ts b/src/tags.ts index 46b1229..212b72d 100755 --- a/src/tags.ts +++ b/src/tags.ts @@ -39,7 +39,9 @@ export class Tags { } } - core.info(`ℹ️ Found ${tagsInfo.length} (fetching max: ${maxTagsToFetch}) tags from the GitHub API for ${owner}/${repo}`) + core.info( + `ℹ️ Found ${tagsInfo.length} (fetching max: ${maxTagsToFetch}) tags from the GitHub API for ${owner}/${repo}` + ) return tagsInfo } @@ -57,7 +59,9 @@ export class Tags { for (let i = 0; i < length; i++) { if (tags[i].name.toLowerCase() === tag.toLowerCase()) { if (ignorePreReleases) { - core.info(`ℹ️ Enabled 'ignorePreReleases', searching for the closest release`) + core.info( + `ℹ️ Enabled 'ignorePreReleases', searching for the closest release` + ) for (let ii = i + 1; ii < length; ii++) { if (!tags[ii].name.includes('-')) { return tags[ii] diff --git a/src/transform.ts b/src/transform.ts index db61ff4..91ec391 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -13,8 +13,8 @@ export function buildChangelog( ): string { // sort to target order const sort = config.sort ?? DefaultConfiguration.sort - const sortAsc = (sort).toUpperCase() ==='ASC' - prs = sortPullRequests( prs, sortAsc) + const sortAsc = sort.toUpperCase() === 'ASC' + prs = sortPullRequests(prs, sortAsc) core.info(`ℹ️ Sorted all pull requests ascending: ${sort}`) const validatedTransformers = validateTransfomers(config.transformers) @@ -34,7 +34,9 @@ export function buildChangelog( ) ) } - core.info(`ℹ️ Used ${validateTransfomers.length} transformers to adjust message`) + core.info( + `ℹ️ Used ${validateTransfomers.length} transformers to adjust message` + ) core.info(`✒️ Wrote messages for ${prs.length} pull requests`) // bring PRs into the order of categories @@ -82,7 +84,9 @@ export function buildChangelog( for (const pr of uncategorized) { changelogUncategorized = `${changelogUncategorized + pr}\n` } - core.info(`✒️ Wrote ${changelogUncategorized.length} non categorized pull requests down`) + core.info( + `✒️ Wrote ${changelogUncategorized.length} non categorized pull requests down` + ) // fill template let transformedChangelog = config.template ?? DefaultConfiguration.template @@ -137,7 +141,8 @@ function transform(filled: string, transformers: RegexTransformer[]): string { function validateTransfomers( specifiedTransformers: Transformer[] ): RegexTransformer[] { - const transformers = specifiedTransformers ?? DefaultConfiguration.transformers + const transformers = + specifiedTransformers ?? DefaultConfiguration.transformers return transformers .map(transformer => { try { diff --git a/src/utils.ts b/src/utils.ts index 08c4d70..a44fdc3 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -40,4 +40,4 @@ export function directoryExistsSync(path: string, required?: boolean): boolean { } throw new Error(`Directory '${path}' does not exist`) -} \ No newline at end of file +}