-
Notifications
You must be signed in to change notification settings - Fork 165
Add version in ADMX name. #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
---|---|---|---|---|---|---|
jscpd | yes | 3 | no | 2.14s | ||
markdownlint | 2 | 0 | 2 | 0 | 0.81s | |
✅ MARKDOWN | markdown-link-check | 2 | 0 | 0 | 5.09s | |
✅ MARKDOWN | markdown-table-formatter | 2 | 0 | 0 | 0 | 0.25s |
✅ POWERSHELL | powershell | 4 | 0 | 0 | 8.38s | |
✅ POWERSHELL | powershell_formatter | 4 | 0 | 0 | 5.87s | |
checkov | yes | 3 | no | 12.76s | ||
devskim | yes | 1 | 8 | 1.38s | ||
✅ REPOSITORY | dustilock | yes | no | no | 0.01s | |
✅ REPOSITORY | gitleaks | yes | no | no | 0.57s | |
✅ REPOSITORY | git_diff | yes | no | no | 0.01s | |
✅ REPOSITORY | grype | yes | no | no | 24.09s | |
✅ REPOSITORY | kics | yes | no | no | 1.61s | |
✅ REPOSITORY | secretlint | yes | no | no | 0.49s | |
✅ REPOSITORY | syft | yes | no | no | 1.13s | |
✅ REPOSITORY | trivy | yes | no | no | 5.26s | |
✅ REPOSITORY | trivy-sbom | yes | no | no | 0.1s | |
✅ REPOSITORY | trufflehog | yes | no | no | 2.24s | |
cspell | 7 | 27 | 0 | 4.83s | ||
✅ SPELL | lychee | 2 | 0 | 0 | 0.7s |
See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true
in mega-linter.yml to validate all sources, not only the diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds version information to ADMX filenames and removes installation reporting functionality. The main purpose is to make ADMX policy template versions more explicit in release artifacts.
Key changes:
- Dynamic versioning of ADMX zip files based on the version specified in the ADMX file
- Removal of GitHub installation counter functionality
- Minor documentation formatting improvements
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
WAU-MSI_Actions.ps1 | Removes installation counter reporting functionality |
README.md | Updates documentation formatting and GPO list configuration explanation |
Sources/Policies/README.md | Changes example formatting from dashes to blockquotes |
.github/workflows/GitFlow_Nightly-builds.yml | Implements dynamic ADMX zip naming with version extraction |
.github/workflows/GitFlow_Make-Release-and-Sync-to-Dev.yml | Implements dynamic ADMX zip naming with version extraction |
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\WAU_ADMX.zip -Force | ||
$admxPath = ".\Sources\Policies\ADMX\WAU.admx" | ||
try { | ||
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern should escape the dot character properly. The current pattern [\d\.]+
allows dots anywhere in the version string, but version numbers typically follow semantic versioning patterns. Consider using a more specific pattern like ([0-9]+(?:\.[0-9]+)*)
to match proper version formats.
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null | |
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([0-9]+(?:\.[0-9]+)*)"' | Out-Null |
Copilot uses AI. Check for mistakes.
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\WAU_ADMX.zip -Force | ||
$admxPath = ".\Sources\Policies\ADMX\WAU.admx" | ||
try { | ||
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern should escape the dot character properly. The current pattern [\d\.]+
allows dots anywhere in the version string, but version numbers typically follow semantic versioning patterns. Consider using a more specific pattern like ([0-9]+(?:\.[0-9]+)*)
to match proper version formats.
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null | |
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([0-9]+(?:\.[0-9]+)*)"' | Out-Null |
Copilot uses AI. Check for mistakes.
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null | ||
$ADMXversion = $matches[1] | ||
$admxZip = "WAU_ADMX_$($ADMXversion).zip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex match result is not being validated. If the match fails, $matches[1]
on line 164 will be undefined, potentially causing an error. Consider checking if the match was successful before accessing $matches[1]
.
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null | |
$ADMXversion = $matches[1] | |
$admxZip = "WAU_ADMX_$($ADMXversion).zip" | |
$admxContent = Get-Content $admxPath -Raw -ErrorAction Stop | |
if ($admxContent -match 'revision="([\d\.]+)"') { | |
$ADMXversion = $matches[1] | |
$admxZip = "WAU_ADMX_$($ADMXversion).zip" | |
} else { | |
throw "Could not find revision in ADMX file." | |
} |
Copilot uses AI. Check for mistakes.
No description provided.