r/adventofcode • • Dec 01 '21

Repo Fancy Badges for your GitHub Repo

So you probably all know these fancy badges displayed on Github in Repository Readmes. I'm using them to display the current day and my stars in AdventOf Code.

As I didn't want to update them by hand I createt the following github action:

https://github.com/J0B10/aoc-badges-action

It can be configured to automatically update the badges daily or whenever you push code.

I created this action last year but havn't sheared it till now.

So have fun with it!

37 Upvotes

17 comments sorted by

View all comments

Show parent comment

1

u/ung3froren Dec 01 '21

You are totally right, I have not thought about trotteling yet.
Till now I only considered it as a small gimmick and thought that users would be reasonable enough to use it in ways that do not spam the server with automated requests.

Overall the action encurages users to keep the amount of requests very low:

The sample config is already set up in a way that only one request per day is sent.

It includes a notice for users that they should make sure to stay under 1 request / 15 mins.

If people really try hard to manipulate the action to hammer aoc they can (as they easily could with a curl request in a loop), but a accidental misuse is unlikely (and will also spam them with workflow runs).

Unfortunatley I think that throtteling will be quite hard to implement for a github action, I have seen no examples yet how this can be done and currently have no idea how to do it.

If you (ore anybody reading this) can point me towards a better solution I'dd apreciate it!