From ec88ecc576b831252cd9abaff8300f68d3d78c1b Mon Sep 17 00:00:00 2001 From: shimataro Date: Mon, 8 Feb 2021 22:59:08 +0900 Subject: [PATCH] change home directory for Docker container --- .github/workflows/verify-on-container.yml | 4 ++-- src/main.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-on-container.yml b/.github/workflows/verify-on-container.yml index ce27fb5..bc98683 100644 --- a/.github/workflows/verify-on-container.yml +++ b/.github/workflows/verify-on-container.yml @@ -22,7 +22,7 @@ jobs: with: key: ${{ secrets.SSH_KEY }} known_hosts: ${{ secrets.KNOWN_HOSTS }} - - name: move .ssh to /root - run: mv ~/.ssh /root + - name: print created files + run: ls -l ~/.ssh - name: git clone through SSH run: git clone git@github.com:shimataro/ssh-key-action.git tmp diff --git a/src/main.ts b/src/main.ts index 4333884..b39d10c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -84,6 +84,12 @@ function getHomeDirectory(): string throw Error(`${homeEnv} is not defined`); } + if(home === "/github/home") + { + // Docker container + return "/root"; + } + return home; }