GitHub Actions: Execute a script file without checkout #26359
-
Just starting with GitHub Actions. Is there a way of bundling script files to be referenced and executed as part of a Step without checking out the repo?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Not as script files, no, you’ll only have access to that after checkout. What’s the issue with checking out the repository? Two possible alternatives, but not exactly what you’re asking for:
|
Beta Was this translation helpful? Give feedback.
-
Thanks. I was exploring GitHub Actions capabilities and I have a workflow that builds, tests and pushes a docker image to a registry. Then I have another workflow that deploys a container on a remote host based on a tag (don’t want to deploy it on every change to a branch). Since the image is already in the registry I have no need to checkout the repo to produce the image. In case of big repo (for example) just seemed a bit wasteful to checkout. The reasoning was also to keep the workflow declaration small and concise by pushing the logic onto script files. I understand there are alternatives, like a dedicated repo or a custom Action. |
Beta Was this translation helpful? Give feedback.
Not as script files, no, you’ll only have access to that after checkout. What’s the issue with checking out the repository?
Two possible alternatives, but not exactly what you’re asking for:
run
block, if it’s not too big.