From bd69b3383f7a71a5ca6545c3138f24df9c8e70e4 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Tue, 18 Mar 2025 11:52:43 -0400 Subject: [PATCH] feat: update production release flow to validate less strictly (#1238) ## Summary by CodeRabbit - **Bug Fixes** - Enhanced error handling during plugin file validation to ensure that any invalid XML inputs are promptly flagged and processed gracefully. - **Chores** - Updated the release workflow configuration to utilize a more flexible XML parsing approach, improving overall validation stability. --- .github/workflows/release-production.yml | 17 ++++++++++++++++- pnpm-lock.yaml | 2 -- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-production.yml b/.github/workflows/release-production.yml index edad79140..e007f6497 100644 --- a/.github/workflows/release-production.yml +++ b/.github/workflows/release-production.yml @@ -66,8 +66,23 @@ jobs: // Validate the plugin file is valid XML const xml2js = require('xml2js'); - const parser = new xml2js.Parser(); + const parser = new xml2js.Parser({ + explicitCharkey: true, + trim: true, + explicitRoot: true, + explicitArray: false, + attrkey: 'ATTR', + charkey: 'TEXT', + xmlnskey: 'XMLNS', + normalizeTags: false, + normalize: false, + strict: false // Try with less strict parsing + }); parser.parseStringPromise(pluginContent).then((result) => { + if (!result) { + console.error('Plugin file is not valid XML'); + process.exit(1); + } console.log('Plugin file is valid XML'); // Write back to file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d1e15d54..4cd161e01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3898,7 +3898,6 @@ packages: '@unraid/libvirt@1.1.3': resolution: {integrity: sha512-aZNHkwgQ/0e+5BE7i3Ru4GC3Ev8fEUlnU0wmTcuSbpN0r74rMpiGwzA/4cqIJU8X+Kj//I80pkUufzXzHmMWwQ==} engines: {node: '>=14'} - cpu: [x64, arm64] os: [linux, darwin] '@unraid/tailwind-rem-to-rem@1.1.0': @@ -9484,7 +9483,6 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} deprecated: |- You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qs@6.13.0: