DEV Community

Michael Sanford
Michael Sanford

Posted on

Clean up Github Actions Workflow Runs in PowerShell

Eager to set up all the CI bells-and-whistles, I went to test out Github Actions Workflows in a small, simple Python project.

I had two peculiarities with the project I was testing it with, though:

  1. It's a serial modem adapter (yes, this kind) and I was using my git repo largely to version code and move it my Raspberry Pi.

  2. After every test, I'd realize I needed another serial setting. Rather than polluting my commit history with broken intermediary projects, I would just amend the same commit and force push over and over. That rendered past Workflow runs uninformative garbage because they no longer referred to commits in the repo's history.

Now that I'm back in a more Operations-focused role, I'm keen to use PowerShell where I can, so I whipped up this "one-liner":

based on the bash-isms found herein (I also posted this as an answer there):

I create a couple workflows in the .github/workflows folder of my repository to experiment with GitHub Actions. I have since learned quite a bit and deleted said "experimental" workflows from my repo. After deleting the "experimental" workflow yaml files and committing the deletions, when I go to the Actions tab…

Discussion (0)