Closed Roflicide closed 3 years ago
Nice, I've also been checking out github actions to replace CircleCi for work. I've also been using actions on a personal repo for my Home Assistant configuration.
This could also come in handy if we ever write tests for the script.
This looks good. Thanks for the suggestion and patch. It looks like we have a lot of cleanup to do..
I accepted this PR, but it doesn't seem to be working. It just posts Error:
without any details of what went wrong. Any ideas?
Hey @sandain, where does it say that error? It looks like it's working to me--it's popping up in the Actions tab, and I see that it's automatically running on your pull request ( #290 )
that's super weird, i have no idea why that is. on my screen i can see it fine:
what does it say when you click on this dropdown on your screen?
It shows in my screenshot above. If I unclick it, it looks like this:
I can get raw log files:
are you able to open the other dropdowns and see output? like this one:
Nope, just "Error:"
Try doing a manual run for me. I think it was working before I did that for the first time. It might break it for you though..
Tested it with a manual run and it still works fine for me. I'm stumped, i think you discovered some bug haha. Maybe try deleting the .github/workflows/shellcheck-action.yml
file (which will automatically delete the action) and re-creating it to see if it will fix the issue?
Well it works on my Windows 10 box!?! Maybe it is an issue with my Ubuntu box? I'll try restarting. Lol
That is weird--maybe try clearing your cookies/cache or using a different browser?
Clearing the cache did the trick. Lol. Thanks for the help!
no problem :)
Hi,
ShellCheck is a popular static-analysis tool for shell scripts that gives warnings on potential coding errors as well as style suggestions.
GitHub Actions is a free service provided by GitHub that enables a continuous integration/automatic testing pipeline. You can create your own actions or browse from their marketplace of community created actions. Essentially, you configure what the triggers for the action will be (such as on a code push or PR request) and the actions will be performed automatically when the event happens.
ShellCheck is useful, but can be a pain to perform every time manually when code changes. This PR adds the ability for ShellCheck to be ran automatically in the mscs repository every time code is pushed or a PR is made, thanks to the ShellCheck community-provided action.
Here's how it works:
Upon a push or a PR to the main branch, the
shellcheck-action.yml
action is triggered.This action runs the ShellCheck script on a GitHub provided Ubuntu machine (what they call "runners"), for free. You can see the action output via the "actions" tab at the top:![image](https://user-images.githubusercontent.com/16924342/116493354-89fe2280-a86c-11eb-897f-8ff86c452181.png)
If errors are detected, the action will failure, and you will get a notice in the PR or the push commit that it failed:
Pretty neat, right? You can see an example of the action working on this PR--the action will trigger, and it should say that all checks have failed since shellcheck detected errors.
In the future, I want to add automatic unit-testing upon pushes/PRs using GitHub Actions + something like shunit2
Let me know what you think!
Thanks