amtoine / nu-git-manager

A collection of Nushell tools to manage Git repositories.
GNU General Public License v3.0
27 stars 2 forks source link

feat: setup nightly flow #82

Closed melMass closed 11 months ago

melMass commented 12 months ago

Text for the squash merge:


reworks the CI logic a bit and introduces the idea of the nightly branch.

execution of the CI


TODO

melMass commented 12 months ago

Mmm for some reason it doesn't run the CI 🤣

amtoine commented 11 months ago

Important the few force-pushes above were solely to make my pure-refactoring changes fit into one commit :wink:

melMass commented 11 months ago

Important I reverted "make the tests manually triggerable" since it will be once merged I believe (and it broke the CI)

melMass commented 11 months ago

There is just one thing we need to do before merge btw! (Add write rights for now push will fail)

amtoine commented 11 months ago

There is just one thing we need to do before merge btw! (Add write rights for now push will fail)

okey, you wanna do that?

there is a single thread missing, i don't know the syntax nor where to search for documentation for it :eyes:

melMass commented 11 months ago

It's just a matter of using the builtin GitHub token I think, I will give it a quick look tonight

amtoine commented 11 months ago

i thought using actions/checkout@v3 and setting up Git's user.name and user.email were enough to allow the CI to push to the repo :open_mouth:

amtoine commented 11 months ago

this CI pushes directly to the repo and i never setup any token in my entire life :wink:

melMass commented 11 months ago

i thought using actions/checkout@v3 and setting up Git's user.name and user.email were enough to allow the CI to push to the repo 😮

That would be insanely insecure.

this CI pushes directly to the repo and i never setup any token in my entire life 😉

This means you enable read and write for all actions. That's not a big deal if you are only using "local" (from the repo) actions and workflows but can be dangerous (theoricaly) otherwise, more info here: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token

Maybe we can just enable it globally you decide

amtoine commented 11 months ago

i now see what you mean @melMass and completely forgot i had to turn that on for nu-criterion-tracker :eyes:

should i tick Read and write permissions in the menu below in > settings > actions > Workflow permissions?

2023-11-15_18-51

melMass commented 11 months ago

should i tick Read and write permissions in the menu below in > settings > actions > Workflow permissions?

That would work, or setting just the permissions on the specific action that requires it. I just quickly checked I might have been too paranoid, there is no real issue in our case for making it global, unless we start relying on a lesser known external action.

I think the attack vectors are mostly that and script injection, the later should be covered by our action encapsulation

amtoine commented 11 months ago

okey let's keep that simple for now then :relieved:

i've turned on Read and write permissions :+1:

amtoine commented 11 months ago

Note i've left the commits above (from 71168be to b3b7ac8 included) to show that i couldn't get https://github.com/amtoine/nu-git-manager/pull/82#discussion_r1394598252 to work :cry:

amtoine commented 11 months ago

Note same here, the last two commits are a failed attempt to apply https://github.com/actions/runner/issues/409#issuecomment-752775072