Skip to content

Commit b6dd699

Browse files
committed
Check if the issue templates package categories are updated
This commit adds a new CI check to make sure the new package categories are synchronized with the supported categories from categories.txt
1 parent 331892b commit b6dd699

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ jobs:
2525
run: flake8 --max-line-length=150
2626
- name: Run isort
2727
run: isort --check --diff --profile black --line-length=120 .
28+
- name: Check issue template package categories
29+
run: |
30+
Install-Module powershell-yaml -Force
31+
$categories = Get-Content -Path categories.txt | Where-Object { $_ -ne "IDA plugins" }
32+
$issueTemplates = Get-ChildItem -Path .github/ISSUE_TEMPLATE -Filter new_*package.yml
33+
34+
foreach ($issueTemplate in $issueTemplates) {
35+
$template = Get-Content -Path $issueTemplate.FullName -Raw | ConvertFrom-Yaml
36+
$category = $template.body | Where-Object { $_.id -eq "category" }
37+
$options = $category.attributes.options | Where-Object { $_ -ne $null }
38+
if (!$options -or (Compare-Object -ReferenceObject $categories -DifferenceObject $options)) {
39+
echo "Issue template $($issueTemplate.Name) supported package categories are not updated"
40+
exit(1)
41+
}
42+
}
43+
44+
exit(0)
2845
- name: Run lint.py
2946
run: python scripts/test/lint.py packages
3047
- name: Run lint.ps1

0 commit comments

Comments
 (0)