There is a default environment variable named GITHUB_WORKSPACE.
The GitHub workspace directory path. The workspace directory contains a subdirectory with a copy of your repository if your workflow uses the actions/checkout action. If you don’t use the actions/checkout action, the directory will be empty. For example, /home/runner/work/my-repo-name/my-repo-name.
If you don’t set working-directory keyword in your step, the default working directory is /home/runner/work/my-repo-name/my-repo-name.
Let me show you an example, there is my file structure in the repo:
After checkout action, these folders and files in the root of my repo will exist under /home/runner/work/orgrepo1/orgrepo1
I want to upload contents under projects/frontend folder. Then I use path: ./projects/frontend/ in firstname.lastname@example.org.
name: publish artifacts
- uses: actions/checkout@v1
- name: Upload artifact
# Artifact name
# Directory containing files to upload