News for hackers. Stuff that matters.
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by nikeee on Monday April 10, 2023 @06:54PM (#35518380)
I've seen something like this being used to show the last X commits in a readme and I hate to be _that_ guy, but do we really need scripts that spin up a VM and install python/ruby/whatever multiple times a day just to potentially update a readme that will only a few people see?

Doing this once a week, like the article mentions, should be good enough for most people. It's not _that_ critical information.

Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by hk1337 on Monday April 10, 2023 @07:27PM (#35518678)
I would even have both repositories on GitHub and see about triggering a workflow in my username repository to run, so it only runs when it needs to.
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by simonw on Monday April 10, 2023 @08:47PM (#35519265)
I do think it's good practice to enable caching, such that your script doesn't hit RubyGems / pip / npm / etc every time it runs.

That way at least the automation activity stays entirely within the GitHub / Azure network.

It looks like you can do that for Ruby by adding this:

https://github.com/actions/cache/blob/master/examples.md#rub...

    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.1
        bundler-cache: true
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by beebmam on Tuesday April 11, 2023 @02:06AM (#35521413)
I'd guess a single search on Google probably consumes more J than this
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by nl on Tuesday April 11, 2023 @03:38AM (#35522031)
In 2011 a search on Google cost roughly 0.0003 kWh[1] (Although I suspect it is more energy efficient now).

According to [2], a small VM uses around 7.5 Wh for 30 minutes (for a blended load of active/idle if I understand it correctly), or 0.00023 kWh per minute. So in very rough numbers with a lot of assumptions if your process takes less than 1:30 to install and run your program you are probably comparable to a Google search. More than that and you are almost certainly less energy efficient.

[1] https://www.nytimes.com/2011/09/09/technology/google-details...

[2] https://www.researchgate.net/figure/Mean-Energy-Consumption-...

Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by nine_k on Tuesday April 11, 2023 @02:31AM (#35521576)
If you want it to be very efficient, pick a language like Rust, Go, Nim, maybe even Crystal or Haskell, which can produce a (mostly) self-contained executable, without installing anything. Write the logic for updating your profile with it, all while honing your efficient coding skills.

The few people who look at your GitHub profile may be some important people, like your every future prospective employer. It may make sense to impress them a little bit.

Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by craigmcnamara on Tuesday April 11, 2023 @03:48AM (#35522096)
Ruby pays the bills and is nice to work with.
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by ethicalsmacker on Tuesday April 11, 2023 @08:23AM (#35524173)
insert cocaine joke
Re:Use GitHub Actions to Make Your GitHub Profile Dynamic by nine_k on Tuesday April 11, 2023 @08:31AM (#35524246)
I think Ruby is fine for the task.

But if anybody wanted to show off the ability to run these updates excessively quickly and economically, there is a number of ways.