-
According to the documentation for the GITHUB_WORKSPACE environment variable here: https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables, the Github workspace patch should contain a copy of the source code. However, this appears to not be the case. The directory is empty when I use it as the working directory and run My workflow looks like this:
Is Github Actions suppose to include a copy of the repository in the working directory or should I use the checkout action to check a copy out? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Coming from the “old” (HCL-based) GitHub Actions, I ran into this problem, too. I think you do have to use the checkout action first, though. That solved my problem. Like so:
I verified that without it I think they might have just copied the part of the docs from the old version. Will send an email to support. Ps.: can’t believe these forums don’t support GitHub markdown syntax :( |
Beta Was this translation helpful? Give feedback.
-
wrote this to support: Hi octocats, This is about the new, YML-based GitHub actions. As per the new docs, I understand that I always need torun a checkout action to use my repo content. Also in the docs, there’s still this part: > The GitHub workspace directory path. The workspace directory contains a subdirectory with a copy of your repository. I think this might be in error, perhaps copy/pasted from the old HCL-based GitHub actions. If I understand correctly, the new GitHub actions always creates Right? |
Beta Was this translation helpful? Give feedback.
-
Thanks for confirming @maxheld83! It looks like the documentation just needs to be updated. |
Beta Was this translation helpful? Give feedback.
Coming from the “old” (HCL-based) GitHub Actions, I ran into this problem, too.
I think you do have to use the checkout action first, though. That solved my problem.
Like so:
I verified that without it
ls github/workspace
is completely empty.I think they might have just copied the part of the docs from the old version. Will send an email to support.
Ps.: can’t believe these forums don’t support GitHub markdown syntax :(