Skip to content

Instantly share code, notes, and snippets.

@cgwalters
Created March 10, 2026 15:53
Show Gist options
  • Select an option

  • Save cgwalters/715bb8ee634f724763f609dffe624e55 to your computer and use it in GitHub Desktop.

Select an option

Save cgwalters/715bb8ee634f724763f609dffe624e55 to your computer and use it in GitHub Desktop.
The "force push to fork's git main" trick to iterate on Github Actions

Efficiently debugging and testing Github Actions without spamming a pull request

Debugging Github Actions can be painful. First of all, I think a good practice is to avoid having substantial amounts of code in the action itself. Repositories under the bootc-dev organization lean into using Justfile as an entrypoint, and most GHA flows invoke just <task> which means it's also easier to reproduce locally.

But still though, some things (especially nontrivial workflows that e.g. lean into using artifacts across jobs) are nontrivial to test locally.

The "force push to git main" trick

So here's the trick: instead of continually force pushing to a PR (and spamming everyone with notifications about pushes there) what I do instead is force push to the main branch of my fork of the repository - then monitor action runs from there.

Although it's not even required to use your fork; a different pattern is to have a <username>/ci-sandbox or equivalent repository.

This pattern works especially well with agentic AI where you can give it a goal of getting the tests to pass and tell it to monitor the jobs. When I do this with sandboxed agents, I give it a limited Github PAT that only allows pushing to the ci-sandbox repository.

Debugging things live

You can also combine this with e.g. tmate github action which gives you (and/or an agent) an interactive shell on the remote runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment