Fix CI: replace brittle HtmlAgilityPack.dll search with PSParseHTML module import#721
Closed
Copilot wants to merge 2 commits into
Closed
Fix CI: replace brittle HtmlAgilityPack.dll search with PSParseHTML module import#721Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…rt; remove duplicate request/parse block Agent-Logs-Url: https://github.com/DevClate/EntraFIDOFinder/sessions/7ecb517c-bbc6-4d57-950b-bc7051393d02 Co-authored-by: DevClate <107187714+DevClate@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job in EntraFIDOFinder
Fix CI: replace brittle HtmlAgilityPack.dll search with PSParseHTML module import
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Export-GHEntraFidowas recursively scanning$HOMEforHtmlAgilityPack.dlland throwing when not found on GitHub-hosted runners, even though the workflow already installsPSParseHTML. The function also duplicated theInvoke-WebRequest/LoadHtmlsequence unnecessarily.Changes
Scripts/Export-GHEntraFido.ps1— replace theGet-ChildItemDLL hunt with a standard module import guard; remove the duplicate web fetch/parse block:.github/workflows/GHMerge.yml— harden the install step to trust PSGallery and verify the import at install time, so failures surface in their own step:Original prompt
Fix the failing GitHub Actions job in repository
DevClate/EntraFIDOFinder.Context:
.github/workflows/GHMerge.ymlf5a4d8dbe04d5be3992f3a38d691809036342b58Merge-GHFidoData, which callsExport-GHEntraFido.Failed to fetch data from URL: HtmlAgilityPack.dll not found. Ensure the dependency is installed before running Export-GHEntraFido.Relevant files already identified:
.github/workflows/GHMerge.ymlScripts/Export-GHEntraFido.ps1Scripts/Merge-GHFidoData.ps1Observed root cause:
PSParseHTML, butScripts/Export-GHEntraFido.ps1manually searches forHtmlAgilityPack.dllunder$HOMEand throws if it cannot find the DLL.Invoke-WebRequest/LoadHtmlsequence and should be cleaned up.Requested change:
HtmlAgilityPack.dllin the runner home directory.PSParseHTML(or otherwise ensuring HtmlAgilityPack types are loaded in a reliable way) before creatingHtmlAgilityPack.HtmlDocument..github/workflows/GHMerge.ymlso the dependency is reliably installed/imported in CI.Acceptance criteria:
HtmlAgilityPack.dll.Merge-GHFidoDatashould still be able to callExport-GHEntraFidosuccessfully in GitHub Actions.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failure is caused by
Export-GHEntraFidonot being able to loadHtmlAgilityPack.dll, even though the workflow installsPSParseHTML.Root cause
In the workflow, the module is installed and imported:
.github/workflows/GHMerge.ymlBut the script still manually searches for a DLL under
$HOME:Scripts/Export-GHEntraFido.ps1That logic is brittle on GitHub-hosted runners and is exactly what throws the error seen in the logs. The exception is surfaced here:
Scripts/Merge-GHFidoData.ps1Best fix
Stop depending on a manual DLL lookup. Since the workflow already imports
PSParseHTML,Export-GHEntraFidoshould either:Recommended code change
Replace the DLL-loading block in
Scripts/Export-GHEntraFido.ps1with a module import guard.