5 ms·
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
by EddTheSDET 3y ago
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.
- edgyquant 3y agoI too wish I could find a nicer way than this to debug.
- somehnguy 3y agoAct 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.
- EddTheSDET 3y ago> 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-running-a-workflow https://docs.github.com/en/actions/using-workflows/manually-...
- mook 3y agoAnd if you're working on workflows that need to be in PRs, you can make a PR from your fork _to_ your fork.
- somehnguy 3y agoYeah 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.
- MoreQARespect 3y agoUsing the same commit-push-debug loop you do. It just isnt painful if I do 2.
- davidmurdoch 3y agoMy GH Actions debugging usually devolves into `git commit -m "wtfqwehsjsidbfjdi"`
- no_wizard 3y agoyou could always do git commit -m "" --allow-empty
- _nhynes 3y agogit commit --amend --no-edit && git push -f
- mdaniel 3y agoWe 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
- totetsu 3y agogit commit -m "--allow-empty"
- diarrhea 3y agoYou can even allow empty messages.
- all2 3y agoThere are ways to run GHA locally. I've tried out one or two of the tools. [0] - [0] https://github.com/nektos/act https://github.com/nektos/act
- EddTheSDET 3y agoI 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