In Maven, I need to provide absolute path to a directory in my project. How can I get absolute path to the directory GitHub action is running in?
2 Answers
In addition to the environment variable described by @Evgeny Bovykin, you can also use the ${{ ...}} syntax with:
${{ github.workspace }}
See the documentation.
1 Comment
anden-akkio
This was the one that worked for me. Think it might have something to do with the above answer only working inside an actual
run: script whereas yours workers even outside of an actual workflow.
checkout/actionson your workflow before accessing the$GITHUB_WORKSPACE? Did you try to save the path as local variable before using it in your workflow? (If yes, could you edit your question with your workflow to see how you did it?)