@@ -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 |
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
+77
-74
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Generated
+907
-925
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user