Skip to content

How can I access the current repo context and files from a Docker container action ? #26855

Answered by Yanjingzhu
obrassard asked this question in Actions
Discussion options

You must be logged in to vote

@obrassard When use a Docker container action in the workflow, it will automatically run with a volume mapping from GITHUB_WORKSPACE (on the runner machine) to /github/workspace (inside container). 

So you could easily get access to your repo files under / github/workspace inside the container.

For example, I want to access to the README.md in my repo,

In my Docker container action > entrypoint.sh, I could use 

cat /github/workspace/README.md

to show the content of README.md. 

Replies: 10 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Dark-Kernel
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nemith
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment