Skip to content

Hack entrypoint to work around Actions setting the working dir #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2022

Conversation

wagnerm
Copy link
Member

@wagnerm wagnerm commented May 11, 2022

Since this Action is in a private repository, you must clone it manually first and then call the Action.

However, since you have to clone the repository into an alternate directory, Actions will start the Docker container with the working directory being that of the calling workflow repository.

Example here:
https://github.com/github/ci-hello-world/runs/6396135283?check_suite_focus=true#step:5:47

The workdir is set to --workdir /github/workspace.

This doesn't work because the go files are actually in /. Since the go files are in fact in / we can just cd to that directory.

I believe this worked implicitly within this repository because the go files happened to also be mounted into the working directory Actions was setting.

Since this Action is in a private repository, you must clone it manully
first and then call the Action.

However, since you have to clone the repository into an alternate
directory, Actions will start the Docker container with the working
directory being that of the calling workflow repository.

Example here:
https://github.com/github/ci-hello-world/runs/6396135283?check_suite_focus=true#step:5:47

The workdir is set to `--workdir /github/workspace`.

This doesn't work because the go files are actually in `/`.
Since the go files are in fact in `/` we can just cd to that directory.

I believe this worked implicitly within this repository because the go files
happened to also be found into the working directory Actions was
setting.
@wagnerm wagnerm requested a review from a team as a code owner May 11, 2022 21:39
@wagnerm wagnerm merged commit aedbbce into main May 11, 2022
@wagnerm wagnerm deleted the wagnerm/hack-entrypoint branch May 11, 2022 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants