Skip to content

Commit

Permalink
Add settings xml validation including an unescaped character check (#135
Browse files Browse the repository at this point in the history
) (#136)

* adding settings xml validation
  • Loading branch information
seanmcne authored Jan 22, 2025
1 parent bd4001d commit bcae673
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/buildsolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@ jobs:
echo "ZipPath=$zipPath" >> $env:GITHUB_ENV
write-host "ZipPath: $ZipPath"
write-host "currentPath: $currentPath"
- name: Validate XML files
uses: action-pack/valid-xml@v1
with:
path: '\\mspfedyn_\\OrgDbOrgSettings\\Solution\\WebResources\\mspfedyn_\\OrgDbOrgSettings\\'
file-endings: '.xml'
- name: Validate XML files and check for unescaped characters
shell: pwsh
run: |
$xmlPath = 'mspfedyn_\OrgDbOrgSettings\Solution\WebResources\mspfedyn_\OrgDbOrgSettings\settings.xml'
try {
[System.Xml.XmlDocument]$xmlDoc = New-Object System.Xml.XmlDocument
$xmlDoc.Load($xmlPath)
Write-Host "XML is well-formed."
} catch {
Write-Host "Error: XML is not well-formed."
Write-Host $_.Exception.Message
if ($_.Exception.InnerException) {
Write-Host $_.Exception.InnerException.Message
}
exit 1
}
- name: apply updated version
run: |
#edit settings.xml build number
Expand Down

0 comments on commit bcae673

Please sign in to comment.