BigJk / snd

Sales & Dungeons — Thermal Printer as D&D / TTRPG Utility
https://sales-and-dungeons.app/
MIT License
474 stars 17 forks source link

Add Validation action to PR and main branch #23

Closed nbadal closed 1 year ago

nbadal commented 1 year ago

This workflow automatically lints and builds the frontend + backend to ensure PRs and commits are mergeworthy 😁

image

Note: Also explicitly use HTTPS for NPM, as it doesn't require an SSH key. I found this useful when testing the action with act for example

BigJk commented 1 year ago

Thanks. Seems useful! I never worked with Github Actions so far. What kind of response would I get if I tried to push commits that result in a linting error? Will this affect all new pushs to master?

nbadal commented 1 year ago

@BigJk GitHub Actions are so nice 😁 Definitely nice to have a "set it and forget it" set of checks to help reduce manual steps.

Unless you have specific branch protections enabled, it shouldn't reject any commits. If a push to master included a lint error, it would simply fail the pipeline and put a ❌ in the UI. No functional difference, just a visual indicator.

Additionally, if you desire, you can enable a setting that requires Pull Requests to pass certain checks before merging. Again, no effect on repository owners though, and you can also override the check as an owner as well.