How to pass the file from same repo to my code #25717
-
Hello, If I have a text file stored in my repo at:
Example below:
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
infosechris:
infosechris:
Yes, the
infosechris:
After checkout the file exists in the workspace, just like in your repository. You can |
Beta Was this translation helpful? Give feedback.
-
Thank you @airtower-luna ! This is very helpful. How do I pass the path into the |
Beta Was this translation helpful? Give feedback.
-
That depends on how your script expects to retrieve the path. The easiest thing would probably be to put the path on the command line, but you could also set an environment variable. |
Beta Was this translation helpful? Give feedback.
-
So technically python is running on same path as the repo, I can just call it with repo/stored_files/hello.txt? Can I call this path inside |
Beta Was this translation helpful? Give feedback.
-
The default working directory is inside your repository, so it’s going to be more like The rest depends on how you want to do things. You can hardcode the path in your script. Whether that’s a good idea depends on what your script is supposed to do. |
Beta Was this translation helpful? Give feedback.
-
Thank you @airtower-luna ! Much appreciate your help and insight! |
Beta Was this translation helpful? Give feedback.
The default working directory is inside your repository, so it’s going to be more like
stored_files/hello.txt
. You can add a step withrun: find .
to see what’s in the workspace.The rest depends on how you want to do things. You can hardcode the path in your script. Whether that’s a good idea depends on what your script is supposed to do.