News for hackers. Stuff that matters.
Re:Using my new Raspberry Pi to run an existing GitHub Action by justinclift on Tuesday March 12, 2024 @03:12AM (#39676918)
Self-hosted runners are also useful when debugging weird behaviour in a GitHub Action.

I do it by spinning up a VM on my local pc, then running the GitHub Actions software in the VM.

This gives a fully working GitHub Actions runner which I can ssh into directly and muck around with to investigate and get things working.

It's also easy to ensure only the right jobs end up on my runner.

The installer for the GitHub Actions runner asks for optional tag names to use, so I add "jc" (my initials) to the tags.

Then I add a matching "jc" to the "runs-on" clause in the workflow in my fork or PR:

    runs-on: [self-hosted, linux, x64, jc]
With that, the GitHub Actions for that workflow only run on my local VM.

Works pretty well. :)

---

Official docs for the labelling bit: https://docs.github.com/en/actions/hosting-your-own-runners/...

Re:Using my new Raspberry Pi to run an existing GitHub Action by leonheld on Tuesday March 12, 2024 @07:49AM (#39678421)
Do you do this for public repos? GitHub Actions is strongly not recommended for non-private. Struggling to have good security policies in place for a deployment I'm doing...
Re:Using my new Raspberry Pi to run an existing GitHub Action by akerl_ on Tuesday March 12, 2024 @08:15AM (#39678574)
Where are you seeing that GitHub actions isn’t recommended for public repos?
Re:Using my new Raspberry Pi to run an existing GitHub Action by theodorton on Tuesday March 12, 2024 @10:16AM (#39679800)
I believe they're referring to this section: https://docs.github.com/en/actions/hosting-your-own-runners/...
Re:Using my new Raspberry Pi to run an existing GitHub Action by bmitc on Tuesday March 12, 2024 @08:13AM (#39678565)
> GitHub Actions is strongly not recommended for non-private.

By who? Why?

Re:Using my new Raspberry Pi to run an existing GitHub Action by Belphemur on Tuesday March 12, 2024 @08:32AM (#39678712)
Sounds like outdated advice from the time before they implemented approval for running action from PR of untrusted people.

In the past, people could modify the GitHub action workflow and run crypto miners on the agents.

But since GitHub changed the default for PR where the actions aren't run anymore that killed that attack vector.

Re:Using my new Raspberry Pi to run an existing GitHub Action by everfrustrated on Tuesday March 12, 2024 @08:54AM (#39678892)
Because the self-hosted runners save state between runs, as well as publicly-opened PRs/branches giving the public access to your runner environment variables/secrets.
Re:Using my new Raspberry Pi to run an existing GitHub Action by justinclift on Tuesday March 12, 2024 @11:56AM (#39681046)
Thanks, I'd not seen that recommendation.

Looks like I'd better do some research too. :)

Re:Using my new Raspberry Pi to run an existing GitHub Action by Etheryte on Tuesday March 12, 2024 @09:05AM (#39678986)
An easier way to debug Github Actions is to use tmate [0]. In short, you can set up an action that allows you to tmate into the worker on failure and then figure out what's wrong. In addition to the default setup, it's recommended to limit access with an SSH key [1].

[0] https://github.com/mxschmitt/action-tmate

[1] https://github.com/mxschmitt/action-tmate?tab=readme-ov-file...

Re:Using my new Raspberry Pi to run an existing GitHub Action by justinclift on Tuesday March 12, 2024 @12:00PM (#39681087)
Thanks, that sounds like it's worth checking out. :)