-
Notifications
You must be signed in to change notification settings - Fork 62
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
Adding git-sub-dir #138
Adding git-sub-dir #138
Conversation
e228681
to
c0ae124
Compare
@khos2ow Any chance someone could take a look at this ? |
7b1d454
to
7e3d42e
Compare
src/docker-entrypoint.sh
Outdated
git_setup() { | ||
# When the runner maps the $GITHUB_WORKSPACE mount, it is owned by the runner | ||
# user while the created folders are owned by the container user, causing this | ||
# error. Issue description here: https://github.com/actions/checkout/issues/766 | ||
git config --global --add safe.directory /github/workspace | ||
git config --global --add safe.directory ${GITHUB_WORKSPACE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think shellcheck wants this to be…
git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" |
@timothyclarke Can you have a look at the failing checks? |
7e3d42e
to
46b135f
Compare
@pascal-hofmann I've done the shellcheck per your suggestion. Hopefully that works. I've also done a %s/1.2.0/1.2.1/g in the readme.md. Hopefully that address that one too. |
Thank you. Somehow validate/readme is still unhappy though. :( |
I need to look a little deeper into this one as I don't have the The Contributing.md doesn't mention this so as soon as I have a better idea on that part I'll update. Note on the contributiing.md, the good hygiene link no longer works |
Signed-off-by: Timothy Clarke <Timothy.Clarke@ServerBox.co.uk>
46b135f
to
34611d2
Compare
@pascal-hofmann I think it's all fixed now. I've also uploaded Contributing.md so anyone else coming along should be able to address these sorts of issues before seeing failing tests. |
@timothyclarke Thanks for work on this! |
Description of your changes
Fixes #102
This action does not currently support code checked out to a directory other than the default
The following checkout would not work without this PR.
The above would generate the following error
Additionally if other repo's are checked out as a subdirectory this will commit that repo as sub-module. While this PR does not directly address the sub-module issue it allows its avoidance by supporting a directory other than
/github/workspace
By introducing the
git-sub-dir
arg and passing that arg to the container we can append the directory. Then everything works as normalI have:
How has this code been tested
I tested this by using the action
timothyclarke/tf-docs-gh-actions@d014534410793a9188ee6b3f1d465505e403db01
main...timothyclarke:tf-docs-gh-actions:checkout-dirNote that branch is slightly different from this PR as I needed to build the docker container and then reference my docker container.
With the above checkout command and the the following action
The test output was