Implement fork check for release task#458
Conversation
|
i believe this should now work |
CarrotManMatt
left a comment
There was a problem hiding this comment.
Why does github.repository not work for the pull request event too. That way it can be simplified?
Annoyingly, I can't seem to find any documentation that explicitly states this, but it appears to be the case |
|
however don't actually merge this yet - noticed something wrong |
|
right that should be good now |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
wait I've just had a thought - surely there's no way a push not on this repo can trigger a workflow, right? so the push check actually isn't needed at all? |
There was a problem hiding this comment.
If a pull request is the only event that can trigger this workflow from another repo then surely we want to allow all other events in this check, not just push. This is so that we don't need to add the new event types to the triggers as well as this check in the future.
Would something like this work?
github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'CSSUoB/TeX-Bot-Py-V2'
I don't know this 100% i was more hoping you would know lol, but yeah if that's defo the case the check can be simplified |
just checked, and even if a push from an external fork could trigger a workflow, our workflow specifically only runs on pushes if it has a version tag, which a fork would (read: should) never have so have simplified the check |
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
.github/workflows/check-build-deploy.yaml:222
- Accessing 'github.event.pull_request.head.repo.full_name' without verifying that 'pull_request' exists may lead to an evaluation error when the event is not a pull_request. Consider adding a check to ensure 'github.event.pull_request' is defined before accessing nested properties.
github.event.pull_request.head.repo.full_name == 'CSSUoB/TeX-Bot-Py-V2'
Not sure I fully understand this?
|


No description provided.