dabapps / django-readers

A lightweight function-oriented toolkit for better organisation of business logic and efficient selection and projection of data in Django projects.
https://www.django-readers.org
BSD 2-Clause "Simplified" License
183 stars 7 forks source link

Fix CI status badge in README #61

Closed j4mie closed 1 year ago

j4mie commented 2 years ago

This seems to just be showing the status of whatever the most recent build happened to be, rather than the status of the main branch. Need to investigate. Thanks for the report @simkimsia

simkimsia commented 2 years ago

@j4mie if you are open to it, I recommend use precommit to replace variables in order to replace {{ current.branch }} with the correct branch name regardless

See https://stackoverflow.com/a/67919523/80353

and then put ?branch={{ current.branch }} as per https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge#using-the-branch-parameter

What say you? I am happy to help by writing a PR. though i have never used pre-commit before. This is my way of helping. I ❤ django-readers

j4mie commented 2 years ago

Thanks! Your "quick fix" is perfect. I'm not a big fan of pre-commit personally.

j4mie commented 2 years ago

Fixed in #63

j4mie commented 2 years ago

Ah this still doesn't work 😆 CI doesn't run on main so it just says "no status". What we want is the status of whatever the last thing that was merged into main is.. which probably isn't possible?

I'm not actually sure what value this badge really adds... maybe we should just remove it.

j4mie commented 1 year ago

I think a good way to do this would be to add

on:
  push:
    branches:
      - main

To the GitHub Actions config so that the tests do run against main after a merge. This means the badge represents "do the tests pass against current main, which I think is what we want.

simkimsia commented 1 year ago

sounds good. wanna try?

j4mie commented 1 year ago

It works! 🙂

image
simkimsia commented 1 year ago

love the green color passing badge! 🙌