@@ -0,0 +1,71 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ develop ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ develop ]
|
||||||
|
schedule:
|
||||||
|
- cron: '41 22 * * 4'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more:
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
@@ -311,7 +311,7 @@ it('Deduplicate duplicated PRs', async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(resultChangelog).toStrictEqual(
|
expect(resultChangelog).toStrictEqual(
|
||||||
`## 🚀 Features\n\n- [ABC-1234] - this is a PR 3 title message\n - PR: #3\n\n## 🐛 Fixes\n\n- [ABC-1234] - this is a PR 3 title message\n - PR: #3\n- [ABC-4321] - this is a PR 2 title message\n - PR: #2\n\n`
|
`## 🚀 Features\n\n- [ABC-1234] - this is a PR 3 title message\n - PR: #3\n\n## 🐛 Fixes\n\n- [ABC-4321] - this is a PR 2 title message\n - PR: #2\n- [ABC-1234] - this is a PR 3 title message\n - PR: #3\n\n`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
+32
-14
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
+730
-726
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -35,25 +35,25 @@
|
|||||||
"@actions/core": "^1.5.0",
|
"@actions/core": "^1.5.0",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@octokit/rest": "^18.9.1",
|
"@octokit/rest": "^18.10.0",
|
||||||
"@types/semver": "^7.3.8",
|
"@types/semver": "^7.3.8",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"webpack": "^5.51.1"
|
"webpack": "^5.52.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.0.1",
|
"@types/jest": "^27.0.1",
|
||||||
"@types/node": "^16.7.2",
|
"@types/node": "^16.9.1",
|
||||||
"@typescript-eslint/parser": "^4.29.3",
|
"@typescript-eslint/parser": "^4.31.1",
|
||||||
"@vercel/ncc": "^0.29.2",
|
"@vercel/ncc": "^0.31.1",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-github": "^4.2.0",
|
"eslint-plugin-github": "^4.3.0",
|
||||||
"eslint-plugin-jest": "^24.4.0",
|
"eslint-plugin-jest": "^24.4.0",
|
||||||
"jest": "^27.0.6",
|
"jest": "^27.2.0",
|
||||||
"jest-circus": "^27.0.6",
|
"jest-circus": "^27.2.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"prettier": "2.3.2",
|
"prettier": "2.4.0",
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^4.4.2"
|
"typescript": "^4.4.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ const mapPullRequest = (
|
|||||||
author: pr.user?.login || '',
|
author: pr.user?.login || '',
|
||||||
repoName: pr.base.repo.full_name,
|
repoName: pr.base.repo.full_name,
|
||||||
labels: new Set(
|
labels: new Set(
|
||||||
pr.labels?.map(lbl => lbl.name?.toLocaleLowerCase() || '') || []
|
pr.labels?.map(lbl => lbl.name?.toLocaleLowerCase('en') || '') || []
|
||||||
),
|
),
|
||||||
milestone: pr.milestone?.title || '',
|
milestone: pr.milestone?.title || '',
|
||||||
body: pr.body || '',
|
body: pr.body || '',
|
||||||
|
|||||||
+3
-1
@@ -67,7 +67,9 @@ export class Tags {
|
|||||||
const length = tags.length
|
const length = tags.length
|
||||||
if (tags.length > 1) {
|
if (tags.length > 1) {
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
if (tags[i].name.toLocaleLowerCase() === tag.toLocaleLowerCase()) {
|
if (
|
||||||
|
tags[i].name.toLocaleLowerCase('en') === tag.toLocaleLowerCase('en')
|
||||||
|
) {
|
||||||
if (ignorePreReleases) {
|
if (ignorePreReleases) {
|
||||||
core.info(
|
core.info(
|
||||||
`ℹ️ Enabled 'ignorePreReleases', searching for the closest release`
|
`ℹ️ Enabled 'ignorePreReleases', searching for the closest release`
|
||||||
|
|||||||
+11
-8
@@ -26,22 +26,25 @@ export function buildChangelog(
|
|||||||
core.info(`ℹ️ Remove duplicated pull requests using \`duplicate_filter\``)
|
core.info(`ℹ️ Remove duplicated pull requests using \`duplicate_filter\``)
|
||||||
|
|
||||||
const deduplicatedMap = new Map<string, PullRequestInfo>()
|
const deduplicatedMap = new Map<string, PullRequestInfo>()
|
||||||
|
const unmatched: PullRequestInfo[] = []
|
||||||
for (const pr of prs) {
|
for (const pr of prs) {
|
||||||
const extracted = extractValues(pr, extractor, 'dupliate_filter')
|
const extracted = extractValues(pr, extractor, 'dupliate_filter')
|
||||||
if (extracted !== null && extracted.length > 0) {
|
if (extracted !== null && extracted.length > 0) {
|
||||||
deduplicatedMap.set(extracted[0], pr)
|
deduplicatedMap.set(extracted[0], pr)
|
||||||
} else {
|
} else {
|
||||||
core.debug(
|
core.info(
|
||||||
`ℹ️ PR (${pr.number}) did not resolve a ID using the \`duplicate_filter\``
|
` PR (${pr.number}) did not resolve an ID using the \`duplicate_filter\``
|
||||||
)
|
)
|
||||||
|
unmatched.push(pr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const deduplicatedPRs = Array.from(deduplicatedMap.values())
|
const deduplicatedPRs = Array.from(deduplicatedMap.values())
|
||||||
|
deduplicatedPRs.push(...unmatched) // add all unmatched PRs to map
|
||||||
const removedElements = prs.length - deduplicatedPRs.length
|
const removedElements = prs.length - deduplicatedPRs.length
|
||||||
core.info(
|
core.info(
|
||||||
`ℹ️ Removed ${removedElements} pull requests during deduplication`
|
`ℹ️ Removed ${removedElements} pull requests during deduplication`
|
||||||
)
|
)
|
||||||
prs = deduplicatedPRs
|
prs = sortPullRequests(deduplicatedPRs, sortAsc) // resort deduplicatedPRs
|
||||||
} else {
|
} else {
|
||||||
core.warning(`⚠️ Configured \`duplicate_filter\` invalid.`)
|
core.warning(`⚠️ Configured \`duplicate_filter\` invalid.`)
|
||||||
}
|
}
|
||||||
@@ -98,7 +101,7 @@ export function buildChangelog(
|
|||||||
for (const [pr, body] of transformedMap) {
|
for (const [pr, body] of transformedMap) {
|
||||||
if (
|
if (
|
||||||
haveCommonElements(
|
haveCommonElements(
|
||||||
ignoredLabels.map(lbl => lbl.toLocaleLowerCase()),
|
ignoredLabels.map(lbl => lbl.toLocaleLowerCase('en')),
|
||||||
pr.labels
|
pr.labels
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -111,7 +114,7 @@ export function buildChangelog(
|
|||||||
if (category.exhaustive === true) {
|
if (category.exhaustive === true) {
|
||||||
if (
|
if (
|
||||||
haveEveryElements(
|
haveEveryElements(
|
||||||
category.labels.map(lbl => lbl.toLocaleLowerCase()),
|
category.labels.map(lbl => lbl.toLocaleLowerCase('en')),
|
||||||
pr.labels
|
pr.labels
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -121,7 +124,7 @@ export function buildChangelog(
|
|||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
haveCommonElements(
|
haveCommonElements(
|
||||||
category.labels.map(lbl => lbl.toLocaleLowerCase()),
|
category.labels.map(lbl => lbl.toLocaleLowerCase('en')),
|
||||||
pr.labels
|
pr.labels
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@@ -344,12 +347,12 @@ function extractValues(
|
|||||||
if (extractor.method === 'match') {
|
if (extractor.method === 'match') {
|
||||||
const lables = onValue.match(extractor.pattern)
|
const lables = onValue.match(extractor.pattern)
|
||||||
if (lables !== null) {
|
if (lables !== null) {
|
||||||
return lables.map(label => label.toLocaleLowerCase())
|
return lables.map(label => label.toLocaleLowerCase('en'))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const label = onValue.replace(extractor.pattern, extractor.target)
|
const label = onValue.replace(extractor.pattern, extractor.target)
|
||||||
if (label !== '') {
|
if (label !== '') {
|
||||||
return [label.toLocaleLowerCase()]
|
return [label.toLocaleLowerCase('en')]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -53,8 +53,14 @@ export function resolveConfiguration(
|
|||||||
const providedConfiguration = readConfiguration(configurationPath)
|
const providedConfiguration = readConfiguration(configurationPath)
|
||||||
if (providedConfiguration) {
|
if (providedConfiguration) {
|
||||||
configuration = providedConfiguration
|
configuration = providedConfiguration
|
||||||
|
core.info(`ℹ️ Configuration successfully loaded.`)
|
||||||
|
if (core.isDebug()) {
|
||||||
|
core.debug(`configuration = ${JSON.stringify(configuration)}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
core.info(`ℹ️ Configuration not provided. Using Defaults.`)
|
||||||
|
}
|
||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user