Re:GitHub Actions could be so much better
by EddTheSDET on Friday September 22, 2023 @02:17PM
(#37615624)
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.
[ Parent
| on HN ]
Re:GitHub Actions could be so much better
by edgyquant on Friday September 22, 2023 @02:42PM
(#37615974)
I too wish I could find a nicer way than this to debug.
Re:GitHub Actions could be so much better
by somehnguy on Friday September 22, 2023 @02:48PM
(#37616043)
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.
Re:GitHub Actions could be so much better
by EddTheSDET on Saturday September 23, 2023 @01:13AM
(#37620730)
> 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-...
Re:GitHub Actions could be so much better
by mook on Saturday September 23, 2023 @02:30AM
(#37621038)
And if you're working on workflows that need to be in PRs, you can make a PR from your fork _to_ your fork.
Re:GitHub Actions could be so much better
by somehnguy on Saturday September 23, 2023 @12:33PM
(#37624781)
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.
Re:GitHub Actions could be so much better
by MoreQARespect on Friday September 22, 2023 @03:52PM
(#37616899)
Using the same commit-push-debug loop you do. It just isnt painful if I do 2.
Re:GitHub Actions could be so much better
by davidmurdoch on Friday September 22, 2023 @08:18PM
(#37619438)
My GH Actions debugging usually devolves into `git commit -m "wtfqwehsjsidbfjdi"`
Re:GitHub Actions could be so much better
by no_wizard on Friday September 22, 2023 @08:47PM
(#37619622)
you could always do git commit -m "" --allow-empty
Re:GitHub Actions could be so much better
by _nhynes on Friday September 22, 2023 @08:57PM
(#37619678)
git commit --amend --no-edit && git push -f
Re:GitHub Actions could be so much better
by mdaniel on Monday September 25, 2023 @04:20PM
(#37650039)
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
Re:GitHub Actions could be so much better
by totetsu on Saturday September 23, 2023 @01:26AM
(#37620774)
git commit -m "--allow-empty"
Re:GitHub Actions could be so much better
by diarrhea on Saturday September 23, 2023 @02:33AM
(#37621053)
You can even allow empty messages.
There are ways to run GHA locally. I've tried out one or two of the tools. [0]
Re:GitHub Actions could be so much better
by EddTheSDET on Saturday September 23, 2023 @01:11AM
(#37620723)
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