How to Keep Processes Running After a GitHub Action Job Ends

 
 
  • Gérald Barré
When a GitHub Actions job finishes, the runner terminates any orphaned processes it started. It identifies these processes by checking for the RUNNER_TRACKING_ID environment variable. Any process with this variable set is treated as a child of the runner and will be stopped. On GitHub-hosted runners, this is usually not a concern since the entire virtual machine is discarded after the job ends. To allow a… [read more]

How to Retrieve Your Windows Product Key Using PowerShell

 
 
  • Gérald Barré
If you need to reinstall Windows, having your original product key is essential for activation. If you can't locate your product key, you can retrieve your current product key using PowerShell. This method is helpful if you have a digital license or purchased Windows online and didn't save the key. Run the following PowerShell command to extract your product key from the Windows Management Instrumentation… [read more]

Improving WASM Performance in Microsoft Edge by Disabling Enhanced Security

 
 
  • Gérald Barré
 
When running a WASM application in Microsoft Edge, you may observe significantly slower performance compared to other browsers (sometimes 5 to 10 times slower). Although Edge uses the same engine as Google Chrome and similar browsers, it introduces a security feature called enhanced security that can impact JS and WASM execution speed. This feature impacts WASM execution by using an interpreter instead of… [read more]

How to Find All Types That Can Be Sealed Using Roslyn

 
 
  • Gérald Barré
In the previous post, I described how to use Roslyn as a library to find all types that could be internal instead of public. Let's continue this series by showing how to find all types that can be sealed in a solution. Marking a type as sealed can improve performance and safety by preventing further inheritance. Note that removing sealed is not a breaking change, so you can safely mark types as sealed… [read more]

How to Find Public Symbols That Can Be Internal Using Roslyn

 
 
  • Gérald Barré
I got a question about how to find all public symbols in a solution that can be internal. This is a common scenario when you want to reduce the visibility of your code to improve encapsulation. You can use Roslyn as a library to analyze the code in a solution and find such symbols. I've already written about how to use Roslyn as a library to analyze and rewrite code in a solution: . This post will build… [read more]

How to Exclude Your Windows App from Screen Capture and Recall

 
 
  • Gérald Barré
Some applications are displaying sensitive information. With Recall, Windows can take a screenshot of your screen regularly and store sensitive information. You can exclude your application from this feature, and screen capture more generally, by using SetWindowDisplayAffinity and the WDA_EXCLUDEFROMCAPTURE flag. This is a Windows API function that allows you to set the display affinity of a window, which… [read more]

Automatically Rerun Failed GitHub Actions Workflows

 
 
  • Gérald Barré
GitHub Actions doesn't provide a built-in way to rerun a run automatically. If you have some flakiness in your jobs, this can be a pain as you have to rerun the workflow manually. Hopefully, you can use the workflow_run event to trigger a new workflow when a previous one fails. This allows you to rerun the failed workflow automatically. Note that the following sample workflow will only rerun the failed… [read more]

How to Merge Two Git Repositories While Preserving History

 
 
  • Gérald Barré
Merging two Git repositories can be useful in scenarios where you want to consolidate related projects into a single repository for easier management, collaboration, and version control. This approach is particularly helpful when two repositories share a common purpose or are tightly coupled, as it simplifies dependency management and ensures all related code resides in one place. Additionally, it can… [read more]

Automating Null-Forgiving Operator Removal in C# Projects

 
 
  • Gérald Barré
Nullable Reference Types are a feature in C# that helps developers avoid null reference exceptions by providing compile-time checks for nullability. This feature was introduced in C# 8.0 and is designed to improve code quality and reduce runtime errors. When the compiler cannot handle all cases, so developers may need to use the null-forgiving operator ! to suppress warnings. This operator tells the… [read more]