AlexsLemonade / training-specific-template

Template repository that can be cloned to create repo for administering a specific training workshop
https://alexslemonade.github.io/training-specific-template/
Other
0 stars 2 forks source link

Add GHA to copy completed notebooks #132

Closed sjspielman closed 1 year ago

sjspielman commented 1 year ago

⚠️ Stacked on #129 Closes #111

This PR adds a github action that will copy completed notebooks from a given tag of training-modules into this template repository (presumably after someone has copied the template!). All repos involved are public, so no special security things here, which is important since we might expect folks running external workshops to use this action.

I developed this workflow in one of my personal repositories so I could spam myself to my heart's content, hence only one commit here. I confirmed it worked for any of the three workshops, but we should still do a final.final round of testing here as well. I figure we may want to get any conceptual reviews implemented first though, so this action currently only runs manually. Once we're confident that this is how the GHA should actually look, I can add a PR target so it will run here.

I made a variety of choices along the way which we can discuss during review if there are strongly differing opinions. Here's what I did!

One key question for reviewers: Would we rather see the bash code pulled out into it's own script to live in scripts/? I was on the fence at the beginning, but now I'm trending towards "yes".

sjspielman commented 1 year ago

My main comment here is that if you already checked out both repos, why use curl?

🤦‍♀️ is my answer I think...!

sjspielman commented 1 year ago

After my first round of excitingly using a different strategy from exercise notebooks, and then almost impressively forgetting I was taking that strategy half-way through writing 🤪, here is round 2!

Again, this was tested in a separate private repo of mine to save us all from spam, hence the single commit (which to be clear I just taught a workshop about how this was a bad practice, but here we are!).

I directly incorporated suggestions myself, including main -> website (thanks, good call), bumping the action to @5, etc. I also did simplify the code, but I decided in the end to use a case statement for this; I think this is much easier to read than the if statements. So, we still get notebooks for a given workshop only (including bulk).

Let me know what you think now, but again, no rush on re-reviewing this today if that's not good for your schedule!

sjspielman commented 1 year ago

Semi-related thought: As we are doing all this rejiggering, is it time to update the default branch to main for these repos?

I had thought about this at one point, but got nervous about finding all the links in all the places since it's spread across several repos. As long as we don't delete master (which I don't think you're suggesting anyways!), then previously-used links should work just fine I suppose. I might call this a "nice to have but let's circle back towards the end of this epic and see what the mess looks like."

jashapiro commented 1 year ago

Semi-related thought: As we are doing all this rejiggering, is it time to update the default branch to main for these repos?

I had thought about this at one point, but got nervous about finding all the links in all the places since it's spread across several repos. As long as we don't delete master (which I don't think you're suggesting anyways!), then previously-used links should work just fine I suppose. I might call this a "nice to have but let's circle back towards the end of this epic and see what the mess looks like."

Yeah, I guess I was thinking that this repo might be the one to start with? Nothing should link back to it that I am aware of...

sjspielman commented 1 year ago

@jashapiro was there anything else here? I think this was pretty much set?