oakbrad / dungeonchurch

D&D group infrastructure & homebrew setting.
https://www.dungeon.church
50 stars 6 forks source link

Github Automation #24

Open oakbrad opened 5 months ago

oakbrad commented 5 months ago

Learn more about Github Actions, Git Hooks, Git Runners.

oakbrad commented 4 months ago

Auto approve the imgbot pull requests: https://medium.com/@dileepkumarjami/auto-approve-and-merge-pull-requests-by-dependabot-using-github-actions-468557967fa4

oakbrad commented 3 months ago

I clearly have no idea what I'm doing, I should figure out how to test these without pushing a change.

Run ammarlakis/action-ajv@master
  with:
    schema: .github/homebrew-schema.json
    data: 5etools-homebrew/*json
    allErrors: true
Error: Failed to validate: no schema with key or ref "https://json-schema.org/draft/2020-12/schema"

Not sure if I'm doing this right, will look into it again later. It did catch errors in the Rider-Waite file, but then fixing those failed with this error.

oakbrad commented 3 months ago

Yes running the npx command works, but fails on not being able to find the files. I probably need to pull the repo first?

On testing Github Actions locally, apparently I am not that dumb there really is no built in way to test Actions without pushing it and then waiting for the stupid thing to run:

oakbrad commented 2 months ago

Ok so now what needs to happen is I need to merge the validate and the update actions into one file.

Set the remote update to needs: the validation job.

Then update will only happen after the schema validates the file. This prevents errors from being able to enter the production site data.

oakbrad commented 2 months ago

Rejecting on failed validation check: https://stackoverflow.com/questions/58654530/how-to-auto-reject-a-pull-request-if-tests-are-failing-github-actions