Merge pull request #610 from mikepenz/develop

dev -> main
This commit is contained in:
Mike Penz
2021-12-04 11:36:11 +01:00
committed by GitHub
10 changed files with 1015 additions and 1014 deletions
+1
View File
@@ -255,6 +255,7 @@ For advanced use cases additional settings can be provided to the action
| `toTag` | Defines until which tag the changelog will consider merged pull requests |
| `path` | Allows to specify an alternative sub directory, to use as base |
| `token` | Alternative config to specify token. You should prefer `env.GITHUB_TOKEN` instead though |
| `baseUrl` | Alternative config to specify base url for GitHub Enterprise authentication. Default value set to `https://api.github.com` |
| `ignorePreReleases` | Allows to ignore pre-releases for changelog generation (E.g. for 1.0.1... 1.0.0-rc02 <- ignore, 1.0.0 <- pick). Only used if `fromTag` was not specified. Default: false |
| `failOnError` | Defines if the action will result in a build failure if problems occurred. Default: false |
| `commitMode` | Special configuration for projects which work without PRs. Uses commit messages as changelog. This mode looses access to information only available for PRs. Default: false |
+9
View File
@@ -6,6 +6,7 @@ jest.setTimeout(180000)
it('Should match generated changelog (unspecified fromTag)', async () => {
const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -31,6 +32,7 @@ it('Should match generated changelog (unspecified fromTag)', async () => {
it('Should match generated changelog (unspecified tags)', async () => {
const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -53,6 +55,7 @@ it('Should match generated changelog (unspecified tags)', async () => {
it('Should use empty placeholder', async () => {
const configuration = resolveConfiguration('', 'configs/configuration.json')
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -76,6 +79,7 @@ it('Should fill empty placeholders', async () => {
'configs_test/configuration_empty_all_placeholders.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -101,6 +105,7 @@ it('Should fill `template` placeholders', async () => {
'configs_test/configuration_empty_all_placeholders.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -126,6 +131,7 @@ it('Should fill `template` placeholders, ignore', async () => {
'configs_test/configuration_empty_all_placeholders.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -151,6 +157,7 @@ it('Uncategorized category', async () => {
'configs_test/configuration_uncategorized_category.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -176,6 +183,7 @@ it('Verify commit based changelog', async () => {
'configs_test/configuration_commits.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'mikepenz',
@@ -201,6 +209,7 @@ it('Verify commit based changelog, with emoji categorisation', async () => {
'configs_test/configuration_commits_emoji.json'
)
const releaseNotesBuilder = new ReleaseNotesBuilder(
null,
null,
'.',
'theapache64',
+2
View File
@@ -30,6 +30,8 @@ inputs:
description: 'If defined, the changelog will get written to this file. (relative to the checkout dir)'
token:
description: 'Defines the token to use to execute the git API requests with, uses `env.GITHUB_TOKEN` by default'
baseUrl:
description: 'Defines the base url for GitHub Enterprise authentication, uses `https://api.github.com` by default'
outputs:
changelog:
description: The built release changelog built from the merged pull requests
Generated Vendored
+77 -74
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+907 -925
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -39,21 +39,21 @@
"@types/semver": "^7.3.9",
"moment": "^2.29.1",
"semver": "^7.3.5",
"webpack": "^5.61.0"
"webpack": "^5.64.4"
},
"devDependencies": {
"@types/jest": "^27.0.2",
"@typescript-eslint/parser": "^5.3.0",
"@types/node": "^16.11.6",
"@vercel/ncc": "^0.31.1",
"eslint": "^8.1.0",
"eslint-plugin-github": "^4.3.3",
"eslint-plugin-jest": "^25.2.3",
"jest": "^27.3.1",
"jest-circus": "^27.3.1",
"@types/jest": "^27.0.3",
"@typescript-eslint/parser": "^5.5.0",
"@types/node": "^16.11.11",
"@vercel/ncc": "^0.33.0",
"eslint": "^8.3.0",
"eslint-plugin-github": "^4.3.5",
"eslint-plugin-jest": "^25.3.0",
"jest": "^27.4.3",
"jest-circus": "^27.4.2",
"js-yaml": "^4.1.0",
"prettier": "2.4.1",
"prettier": "2.5.0",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
"typescript": "^4.5.2"
}
}
+2
View File
@@ -24,6 +24,7 @@ async function run(): Promise<void> {
)
// read in repository inputs
const baseUrl = core.getInput('baseUrl')
const token = core.getInput('token')
const owner = core.getInput('owner') || github.context.repo.owner
const repo = core.getInput('repo') || github.context.repo.repo
@@ -36,6 +37,7 @@ async function run(): Promise<void> {
const commitMode = core.getInput('commitMode') === 'true'
const result = await new ReleaseNotesBuilder(
baseUrl,
token,
repositoryPath,
owner,
+3 -1
View File
@@ -8,6 +8,7 @@ import {fillAdditionalPlaceholders} from './transform'
export class ReleaseNotesBuilder {
constructor(
private baseUrl: string | null,
private token: string | null,
private repositoryPath: string,
private owner: string | null,
@@ -40,7 +41,8 @@ export class ReleaseNotesBuilder {
// load octokit instance
const octokit = new Octokit({
auth: `token ${this.token || process.env.GITHUB_TOKEN}`
auth: `token ${this.token || process.env.GITHUB_TOKEN}`,
baseUrl: `${this.baseUrl || "https://api.github.com"}`
})
// ensure proper from <-> to tag range