pyiron / actions

A centralized location for our GitHub actions
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Label to title #125

Closed samwaseda closed 1 month ago

samwaseda commented 1 month ago

I did more or less what @liamhuber said here

samwaseda commented 1 month ago

I'm testing it here but so far it's not working.

liamhuber commented 1 month ago

I'm testing it here but so far it's not working.

I'm on mobile, but it looks like the test location needs the "uses" clause nested inside the regular "steps" field; take a look at pyiron workflow or some of the actions reusable workflows for something to mimic

samwaseda commented 1 month ago

The other ones use yml files from .github/workflow/xyz.yml. Should I make a file there?

liamhuber commented 1 month ago

No, just invoke it like a usual action invocation: https://github.com/pyiron/actions/blob/606379c4edf66e4fcd5c44dfd03cc1b5f453288b/.github/workflows/release.yml#L21

liamhuber commented 1 month ago

Showing my work: I grabbed the github.token recommendation from ChatGPT, but it looks super familiar and I was hunting for that answer, so I think I read it in the docs. The shell lines are just copy-pasted from the other places we use the shell.

liamhuber commented 1 month ago

Alternatively, we could take the token as explicit input like the checkout action does:

https://github.com/pyiron/actions/blob/606379c4edf66e4fcd5c44dfd03cc1b5f453288b/.github/workflows/push-pull.yml#L179-L181

liamhuber commented 1 month ago

Actually, that's probably wiser -- we might get away with secrets being automatically inherited when we use the action inside the pyiron org, but it is just generally a great action and we want it available globally.

liamhuber commented 1 month ago

https://github.com/pyiron/elaston/pull/18#issuecomment-2287925789

But don't merge yet, let's try from a repo outside the org to make sure the secret still passes

liamhuber commented 1 month ago

Hmm, runs but doesn't fail hard when I try it in my own namespace: https://github.com/liamhuber/action-test/actions/runs/10382454910/job/28745564689?pr=2

EDIT: runs but doesn't work, critically

liamhuber commented 1 month ago

Even with the token getting passed in, I'm still getting the same access error from outside the org:

 {
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/issues/issues#update-an-issue",
  "status": "403"
}

I've got to go to bed, but I'll be available tomorrow at some point in the AM to take another look

liamhuber commented 1 month ago

Ahh, ok, the problem was on the side of the repo, not the side of the action! I hadn't configured the repo to allow actions to modify stuff:

Screen Shot 2024-08-14 at 09 15 55

With that done it's working fine!

I want to try:

samwaseda commented 1 month ago

Yeah I thought about the first point. For the second point I got the feeling that it’s more important to have the tag in the title than as a label so I guess we can leave it for now.