Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug GitHub Actions workflow faster?

I find it unproductive to edit yml file, then push a new commit again, and repeat the process hundreds of times until you make it right. I began thinking about how to automate this tedious process.

I tried GitHub Actions logging but doesn't help much.

like image 309
Cristian F. Avatar asked Apr 01 '26 10:04

Cristian F.


2 Answers

Install actionlint and nektos/act on your local machine.

  • Lint your workflow with actionlint. Fix issues if any.
  • After linting, run your workflow with act. Update your workflow if required and proceed accordingly.

If you're using VS Code then you can install Github Actions Locally extension. It's in its beta so proceed accordingly. It uses nektos/act under the hood.

like image 66
Azeem Avatar answered Apr 08 '26 19:04

Azeem


Edit/Update:

GitHub just announced a VS Code extension which you can use.

Today, we’re excited to announce the release of the public beta of the official GitHub Actions VS Code extension. The extension provides support for authoring and editing workflows and helps you manage workflow runs without leaving your IDE.


In addition to Azeem's answer, you can install YAML extension for VSCode.

For Jetbrains' tools refer to this comment:

On the bottom right, click on "No JSON Schema"

enter image description here

Then choose "GitHub workflow"

enter image description here

Basically, you want that your IDE or text editor to load Github Actions' JSON schema.

like image 20
Fcmam5 Avatar answered Apr 08 '26 17:04

Fcmam5



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!