Skip to content

Commit

Permalink
Merge pull request #1340 from mikepenz/fix/spelling_fixes
Browse files Browse the repository at this point in the history
Fix spelling mistakes
  • Loading branch information
mikepenz authored Jun 20, 2024
2 parents 53bdb59 + bdeb796 commit 67e423e
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions __tests__/demo/demo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const token = process.env.GITHUB_TOKEN || ''
const githubRepository = new GithubRepository(token, undefined, '.')
it('Test custom changelog builder', async () => {
// define the configuration file to use.
// By default it retireves a configuration from a json file
// By default, it retrieves a configuration from a json file
// You can also quickly modify in code.
const configuration = mergeConfiguration(undefined, resolveConfiguration('', 'configs/configuration.json'))

Expand All @@ -27,14 +27,14 @@ it('Test custom changelog builder', async () => {
'2.0.0', // `toTag` The to tag name or the SHA1 of the to commit
false, // `includeOpen` Define if you want to include open PRs into the changelog
false, // `failOnError` Define if the action should fail on errors
false, // `ignorePrePrelease` used if no `fromTag` is defined to resolve the prior tag
false, // `ignorePrePrerelease` used if no `fromTag` is defined to resolve the prior tag
false, // `fetchViaCommits` enable to fetch via commits
false, // `fetchReviewers` Enables fetching of reviewers for building the changlog (does additional API requests)
false, // `fetchReviewers` Enables fetching of reviewers for building the changelog (does additional API requests)
false, // `fetchReleaseInformation` Enable to fetch release information (does additional API requests)
false, // `fetchReviews` Enable to fetch reviews of the PRs (does additional API requests)
'PR', // `mode` Set the mode to use [PR, COMMIT, HYBRID]. PR -> builds changelog using PRs, COMMIT -> using commits, HYBRID -> Uses both
false, // `exportCache` Exports the fethced information to the cahce. Not relevant for this test
false, // `exportOnly` Enables to only export the fetched information however not build a changleog
false, // `exportCache` Exports the fetched information to the cache. Not relevant for this test
false, // `exportOnly` Enables to only export the fetched information however not build a changelog
null, // `cache` Path to the cache. Not relevant for this test.
configuration // The configuration to use for building the changelog
)
Expand Down
20 changes: 10 additions & 10 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface Category {
empty_content?: string // if the category has no matching PRs, this content will be used. If not set, the category will be skipped in the changelog.
categories?: Category[] // allows for nested categories, items matched for a child category won't show up in the parent
consume?: boolean // defines if the matched PR will be consumed by this category. Consumed PRs won't show up in any category *after*
entries?: string[] // array of single changelog entries, used to construc the changelog. (this is filled during the build)
entries?: string[] // array of single changelog entries, used to construct the changelog. (this is filled during the build)
}

/**
Expand Down Expand Up @@ -60,7 +60,7 @@ export interface TagResolver {
export interface Placeholder {
name: string // the name of the new placeholder
source: string // the src placeholder which will be used to apply the transformer on
transformer: Regex // the transformer to use to transform the original placeholder into the custom placheolder
transformer: Regex // the transformer to use to transform the original placeholder into the custom placeheolder
}

export const DefaultConfiguration: Configuration = {
Expand Down Expand Up @@ -94,13 +94,13 @@ export const DefaultConfiguration: Configuration = {
labels: []
}
], // the categories to support for the ordering
ignore_labels: ['ignore'], // list of lables being ignored from the changelog
ignore_labels: ['ignore'], // list of labels being ignored from the changelog
label_extractor: [], // extracts additional labels from the commit message given a regex
duplicate_filter: undefined, // extract an identifier from a PR used to detect duplicates, will keep the last match (depends on `sort`)
transformers: [], // transformers to apply on the PR description according to the `pr_template`
tag_resolver: {
// defines the logic on how to resolve the previous tag, only relevant if `fromTag` is not specified
method: 'semver', // defines which method to use, by default it will use `semver` (dropping all non matching tags). Alternative `sort` is also available.
method: 'semver', // defines which method to use, by default it will use `semver` (dropping all non-matching tags). Alternative `sort` is also available.
filter: undefined, // filter out all tags not matching the regex
transformer: undefined // transforms the tag name using the regex, run after the filter
},
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ async function run(): Promise<void> {
if (configurationJson) {
configJson = parseConfiguration(configurationJson)
if (configJson) {
core.info(`ℹ️ Retreived configuration via 'configurationJson'.`)
core.info(`ℹ️ Retrieved configuration via 'configurationJson'.`)
}
}
// read in the configuration from the file if possible
const configurationFile: string = core.getInput('configuration')
const configFile = resolveConfiguration(repositoryPath, configurationFile)
if (configFile) {
core.info(`ℹ️ Retreived configuration via 'configuration' (via file).`)
core.info(`ℹ️ Retrieved configuration via 'configuration' (via file).`)
}

if (!configJson && !configFile) {
Expand Down
2 changes: 1 addition & 1 deletion src/pr-collector/pullRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class PullRequests {
if (reviews && (reviews?.length || 0) > 0) {
core.info(`ℹ️ Retrieved ${reviews.length || 0} review(s) for PR ${owner}/${repo}/#${pr.number}`)

// backwards compatiblity
// backwards compatibility
pr.approvedReviewers = reviews.filter(r => r.state === 'APPROVED').map(r => r.author)
} else {
core.debug(`No reviewer(s) for PR ${owner}/${repo}/#${pr.number}`)
Expand Down
2 changes: 1 addition & 1 deletion src/pr-collector/regexUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function transformStringToValue(value: string, extractor: RegexTransforme

function transformRegexr(regex: RegExp, source: string, target: string): Set<string> | null {
/**
* Util funtion extracted from regexr and is licensed under:
* Util function extracted from regexr and is licensed under:
*
* RegExr: Learn, Build, & Test RegEx
* Copyright (C) 2017 gskinner.com, inc.
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/GithubRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class GithubRepository extends BaseRepository {
labels: this.attachSpecialLabels(status, pr.labels?.map(lbl => lbl.name?.toLocaleLowerCase('en') || '') || []),
milestone: pr.milestone?.title || '',
body: pr.body || '',
assignees: pr.assignees?.map(asignee => asignee?.login || '') || [],
assignees: pr.assignees?.map(assignee => assignee?.login || '') || [],
requestedReviewers: pr.requested_reviewers?.map(reviewer => reviewer?.login || '') || [],
approvedReviewers: [],
reviews: undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
const deduplicatedMap = new Map<string, PullRequestInfo>()
const unmatched: PullRequestInfo[] = []
for (const pr of prs) {
const extracted = extractValues(pr, extractor, 'dupliate_filter')
const extracted = extractValues(pr, extractor, 'duplicate_filter')
if (extracted !== null && extracted.length > 0) {
deduplicatedMap.set(extracted[0], pr)
} else {
Expand Down Expand Up @@ -513,7 +513,7 @@ function handlePlaceholder(
if (transformer?.pattern) {
const extractedValue = transformStringToOptionalValue(value, transformer)
// note: `.replace` will return the full string again if there was no match
// note: This is mostly backwards compatiblity
// note: This is mostly backwards compatibility
if (extractedValue && ((transformer.method && transformer.method !== 'replace') || extractedValue !== value)) {
if (placeholderPrMap) {
createOrSet(placeholderPrMap, placeholder.name, extractedValue)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function readConfiguration(filename: string): Configuration | undefined {
*/
export function parseConfiguration(config: string): Configuration | undefined {
try {
// for compatiblity with the `yml` file we require to use `#{{}}` instead of `${{}}` - replace it here.
// for compatibility with the `yml` file we require to use `#{{}}` instead of `${{}}` - replace it here.
const configurationJSON: Configuration = JSON.parse(config.replace(/\${{/g, '#{{'))
return configurationJSON
} catch (error) {
Expand Down

0 comments on commit 67e423e

Please sign in to comment.