Skip to content

Commit 20b504c

Browse files
committed
Attempt to fix
1 parent 8e7fee0 commit 20b504c

4 files changed

Lines changed: 326 additions & 27 deletions

File tree

.github/actions/labeler/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: "PR Labeler"
2-
description: "Labels PRs based on both title prefix AND file changes"
3-
author: "Mateusz Łopaciński (https://github.com/MatiPl01)"
1+
name: 'PR Labeler'
2+
description: 'Labels PRs based on both title prefix AND file changes'
3+
author: 'Mateusz Łopaciński (https://github.com/MatiPl01)'
44
# Uses environment variables:
55
# GITHUB_TOKEN: GitHub token for API access
66
# CONFIG_FILE: Path to the labeler configuration file (default: labeler-config.yml)
77
runs:
8-
using: "node20"
9-
main: "index.js"
8+
using: 'node20'
9+
main: 'index.js'

.github/actions/labeler/labeler-config.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,32 @@ titleMappings:
7272
fileMappings:
7373
- label: documentation
7474
patterns:
75-
- "packages/docs/**"
76-
- "**/README.md"
77-
- "**/*.md"
75+
- 'packages/docs/**'
76+
- '**/README.md'
77+
- '**/*.md'
7878

7979
- label: example
8080
patterns:
81-
- "example/**"
81+
- 'example/**'
8282

8383
- label: test
8484
patterns:
85-
- "**/*.test.*"
86-
- "**/*.spec.*"
87-
- "**/__tests__/**"
88-
- "**/tests/**"
89-
- "**/__mocks__/**"
85+
- '**/*.test.*'
86+
- '**/*.spec.*'
87+
- '**/__tests__/**'
88+
- '**/tests/**'
89+
- '**/__mocks__/**'
9090

9191
- label: ci
9292
patterns:
93-
- ".github/**"
94-
- "**/workflows/**"
95-
- "**/.github/**"
93+
- '.github/**'
94+
- '**/workflows/**'
95+
- '**/.github/**'
9696

9797
- label: dependencies
9898
patterns:
99-
- "**/package.json"
100-
- "**/yarn.lock"
101-
- "**/package-lock.json"
102-
- "**/pnpm-lock.yaml"
103-
- "**/bun.lockb"
99+
- '**/package.json'
100+
- '**/yarn.lock'
101+
- '**/package-lock.json'
102+
- '**/pnpm-lock.yaml'
103+
- '**/bun.lockb'

.github/actions/labeler/package-lock.json

Lines changed: 285 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/labeler/utils/config.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function loadConfiguration(configFilePath) {
1616
const configContent = fs.readFileSync(configPath, 'utf8');
1717
return yaml.load(configContent);
1818
} catch (error) {
19-
console.error(`❌ Error reading config file "${configFilePath}": ${error.message}`);
19+
console.error(
20+
`❌ Error reading config file "${configFilePath}": ${error.message}`
21+
);
2022
process.exit(1);
2123
}
2224
}
@@ -33,8 +35,14 @@ function validateConfiguration(config) {
3335
// Validate title mappings
3436
if (config.titleMappings) {
3537
for (const mapping of config.titleMappings) {
36-
if (!mapping.label || !mapping.prefixes || !Array.isArray(mapping.prefixes)) {
37-
console.error('❌ Invalid title mapping structure. Expected: { label: string, prefixes: string[] }');
38+
if (
39+
!mapping.label ||
40+
!mapping.prefixes ||
41+
!Array.isArray(mapping.prefixes)
42+
) {
43+
console.error(
44+
'❌ Invalid title mapping structure. Expected: { label: string, prefixes: string[] }'
45+
);
3846
process.exit(1);
3947
}
4048
}
@@ -43,8 +51,14 @@ function validateConfiguration(config) {
4351
// Validate file mappings
4452
if (config.fileMappings) {
4553
for (const mapping of config.fileMappings) {
46-
if (!mapping.label || !mapping.patterns || !Array.isArray(mapping.patterns)) {
47-
console.error('❌ Invalid file mapping structure. Expected: { label: string, patterns: string[] }');
54+
if (
55+
!mapping.label ||
56+
!mapping.patterns ||
57+
!Array.isArray(mapping.patterns)
58+
) {
59+
console.error(
60+
'❌ Invalid file mapping structure. Expected: { label: string, patterns: string[] }'
61+
);
4862
process.exit(1);
4963
}
5064
}

0 commit comments

Comments
 (0)