Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How DO you debug your actions? I spend so long in the commit-action-debug-change loop it’s absurd. I agree with your point re: 2 wholeheartedly though, it makes debugging scripts so much easier too. CI should be runnable locally and GitHub actions, while supported with some tooling, still isn’t very easy to work with like that.


Using the same commit-push-debug loop you do. It just isnt painful if I do 2.


My GH Actions debugging usually devolves into `git commit -m "wtfqwehsjsidbfjdi"`


you could always do git commit -m "" --allow-empty


    git commit --amend --no-edit && git push -f


We may be splitting hairs given what this thread is going on about, but I strongly advocate for `--force-with-lease` as a sane default versus `-f` so that one does not blow away unexpectedly newer commits to the branch

The devil's in the details, etc, etc, but I think it's a _much_ more sane default, even for single-user setups/branches because accidents can happen and git DGAF


git commit -m "--allow-empty"


You can even allow empty messages.


There are ways to run GHA locally. I've tried out one or two of the tools. [0]

- [0] https://github.com/nektos/act


I tried Act at one point but couldn't get it to run the whole pipeline correctly, it might have improved since though so I'll try it out again soon


Act works pretty well to debug actions locally. It isn't perfect, but I find it handles about 90% of the write-test-repeat loop and therefore saves my teammates from dozens of tiny test PRs.


> saves my teammates from dozens of tiny test PRs

May have misread this but you know you can push to one branch and then run the action against it? Would reduce PRs if you're doing that to then check the action in master. You have to add a workflow_dispatch to the action: https://docs.github.com/en/actions/using-workflows/manually-...


Yeah most of the time that is a good way to test. There are some specific actions that aren't easily tested outside of the regular spot though. Mostly deployment related pieces due to the way our infrastructure is setup.


And if you're working on workflows that need to be in PRs, you can make a PR from your fork _to_ your fork.


I too wish I could find a nicer way than this to debug.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: