Re: [hatari-devel] github hatari

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

Attached is a patch that causes repo-sync.yml to run only on hatari/hatari and not on a fork.

In order for the workflow to run, the repository name must precisely match 'hatari/hatari'. (That's not _quite_ the same approach that EmuTOS's emutosbuild.yml takes, which is to compare the repository name with a prefix 'emutos/').

I've tested it on my fork of Hatari; it successfully causes repo-sync.yml to be skipped on that repo. I'm not able to test it on hatari/hatari but I have tested that, if I compare the repo name with 'cdpjenkins/hatari' instead then the action does run against my fork.

One thing that I do notice: repo-sync.yml requires additional permissions if the sync causes a workflow to be updated (which is what happens if repo-sync.yml itself is updated by the sync). So if the GitHub personal access token in 'hatari/hatari' doesn't have that permission then it might be necessary to manually sync that repo the first time (or generate a token with more permissions). This is what I saw when it failed in this way:

! [remote rejected] tmp_upstream/master -> master (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/repo-sync.yml` without `workflow` scope)

Anyway, please let me know if the above patch is useful.

Cheers,
Chris

 
EmuTOS indeed has a check in its Github action not run (and then fail) in forks.

Regards
Christian 



Von: Chris Jenkins <cdpjenkins@xxxxxxxxx>
Gesendet: Dienstag, August 29, 2023 9:24:54 AM
Betreff: Re: [hatari-devel] github hatari

Hi all,

I have a personal mirror of the Hatari source in GitHub which I updated for the first time in a long time today. This pulled in the GitHub action .github/workflows/repo-sync.yml that performs the sync from tuxfamily to GitHub. This was failing for me because I hadn't set up a personal access token as a secret variable MIRROR_PAT in my repository. (I only noticed when I realised I had multiple failed runs of repo-sync.yml, one every six hours since I manually updated the code in my mirror!)

I have fixed the problem in my mirror by adding a personal access token as a secret variable. The sync now runs successfully every six hours and I'm happy because I'm no longer receiving emails about failed actions.

But this made me wonder: did I do the right thing? I'm not a big Hatari developer and it's a little wasteful to update my personal mirror every six hours.. Would it be more appropriate to make a change such that the repo-sync.yml action only runs on the repo github.com/hatari/hatari and not in any other mirrors?

Ways that this could be achieved:

- Check the repo name in repo-sync.yml and only run the action if the repo is hatari/hatari
- Add an environment variable that controls whether the action runs
- Something else (I'm not a heavy GitHub user so there might be something obvious that I've missed!)

Do any of the above options sound like a good idea?

Cheers,
Chris



On Sun, 26 Feb 2023 at 15:06, Thomas Huth <th.huth@xxxxxxxxx> wrote:
Am Wed, 22 Feb 2023 18:40:42 +0000
schrieb Thomas Huth <th.huth@posteode>:

> Am Wed, 22 Feb 2023 10:16:25 +0100
> schrieb Christian Zietz <czietz@xxxxxxx>:
>
> > Miro Kropáček schrieb:
> >   
> > > in case somebody hasn't noticed (like me): the github mirror
> > > (https://github.com/hatari/hatari)
> > > has stopped working since some time ago. So use the official repository:
> > > https://git.tuxfamily.org/hatari/hatari.git if not done already.   
>
> Yes, sorry for that. I used the mirroring feature from gitlab.com to
> automatically mirror the repo from tuxfamily to gitlab and from there to
> github. But a couple of week ago, gitlab decided that mirroring is now a
> premium feature you've got to pay for, so the automatic mirroring does not
> work anymore now. I'm still updating the gitlab and github repos manually
> every other weekend or so, but of course this means that they are falling
> behind in between.
>
> When I've got a lot of spare time again, I have to look for an alternative
> for automatic mirroring, but that won't happen any time soon, I guess.

FWIW, I had a quick try in some spare minutes at the weekend, and I luckily
found a way to enable automatic mirroring again. So the github mirror
should be up to date again now (it gets sync'ed multiple times a day).

 Thomas



Attachment: 0001-Only-run-repo-sync.yml-on-hatari-hatari.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/