Skip to content

Commit bb49ebd

Browse files
committed
[FIXUP]
1 parent 68b0bb9 commit bb49ebd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/checkAcknowledgements.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
with:
16+
fetch-depth: 0
1517
- name: Determine changed files
1618
id: changed-files
1719
run: |
@@ -25,7 +27,7 @@ jobs:
2527
script: |
2628
const fs = require('fs')
2729
const files = '${{ steps.changed-files.outputs.files }}'.trim().split(/\r?\n/)
28-
const nameIdRegex = /\[(?<name>[^\]]+)\]\(https:\/\/github\.com\/(?<id>[^\)]+)\)/g
30+
const nameIdRegex = /\[(?<name>[^\]]+)\]\(https:\/\/github\.com\/(?<id>[^\)/]+)\)/g
2931
const contributorNames = new Map()
3032
for (file of files) {
3133
let lines = fs.readFileSync(file, {encoding: 'utf8'}).split(/\r?\n/)
@@ -35,15 +37,15 @@ jobs:
3537
}
3638
}
3739
}
38-
let boolean hasMultipleNames = false
40+
let hasMultipleNames = false
3941
for (const [profile, names] of contributorNames) {
4042
if (names.size > 1) {
41-
core.error('Multiple names found for profile '" + profile + "': ' + Array.from(names).join(', '))
43+
core.error("Multiple names found for profile '" + profile + "': " + Array.from(names).join(', '))
4244
hasMultipleNames = true
4345
}
4446
}
4547
if (hasMultipleNames) {
46-
throw new Error('No selected name for profile: ' + profile)
48+
throw new Error('Multiple names detected. See log for details.')
4749
}
4850
4951
function computeIfAbsent(map, key, valueSupplier) {

.github/workflows/generateAcknowledgements.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
profile = committerProfile
128128
}
129129
contributors.add(profile)
130-
computeIfAbsent(contributorNames, profile, () => new Set()).add(authorName)
130+
computeIfAbsent(contributorNames, profile, () => new Set()).add(authorName.trim())
131131
} else { // author is null for directly pushed commits, which happens e.g. for I-build submodule updates
132132
console.log("Skip commit of " + authorName)
133133
}
@@ -144,11 +144,11 @@ jobs:
144144
const acknowledgementsFile = 'website/news/${{ inputs.eclipse-version }}/acknowledgements.md'
145145
let lines = fs.readFileSync(acknowledgementsFile, {encoding: 'utf8'}).split(/\r?\n/)
146146
147-
const nameIdRegex = /\[(?<name>[^\]]+)\]\(https:\/\/github\.com\/(?<id>[^\)]+)\)/g
147+
const nameIdRegex = /\[(?<name>[^\]]+)\]\(https:\/\/github\.com\/(?<id>[^\)/]+)\)/g
148148
const existingContributorNames = new Map()
149149
for (line of lines) {
150150
for (match of line.matchAll(nameIdRegex)) {
151-
existingContributorNames.set(match.groups.id, match.groups.name)
151+
existingContributorNames.set(match.groups.id.trim(), match.groups.name.trim())
152152
}
153153
}
154154
// ------------------------------------------------------

0 commit comments

Comments
 (0)