From 061497f8a29e933541318a10cb7b14cdfa59da5f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sat, 16 Jul 2022 09:00:11 +0200 Subject: [PATCH 1/3] limit-access-to-actor default to true --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 52f77e79..7c7db4df 100644 --- a/src/index.js +++ b/src/index.js @@ -74,7 +74,7 @@ export async function run() { } let newSessionExtra = "" - if (core.getInput("limit-access-to-actor") === "true") { + if (core.getInput("limit-access-to-actor") !== "false") { const { actor } = github.context const octokit = new Octokit() From 00be0d92c52f612f963d8f9c037fca18e3e4814a Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sat, 16 Jul 2022 09:03:19 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a4c0954..d95a6867 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ jobs: ## Use registered public SSH key(s) -By default anybody can connect to the tmate session. You can opt-in to install the public SSH keys [that you have registered with your GitHub profile](https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account). +By default only the user who has triggered the action can connect to the tmate session with [the SSH keys that are registered with the GitHub profile](https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account). You can opt-out of this by setting `limit-access-to-actor` to `false` ```yaml name: CI @@ -139,7 +139,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 with: - limit-access-to-actor: true + limit-access-to-actor: false ``` If the registered public SSH key is not your default private SSH key, you will need to specify the path manually, like so: `ssh -i `. From 3bb8b9f0d9e807515c2f8c69adf49a5a0dcdd831 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 7 Aug 2022 07:54:49 +0200 Subject: [PATCH 3/3] Improve advice on missing ssh key --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 7c7db4df..acf0dde3 100644 --- a/src/index.js +++ b/src/index.js @@ -82,7 +82,7 @@ export async function run() { username: actor }) if (keys.data.length === 0) { - throw new Error(`No public SSH keys registered with ${actor}'s GitHub profile`) + throw new Error(`No public SSH keys registered with ${actor}'s GitHub profile, add an SSH key (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) or set \`limit-access-to-actor: false\` to allow anyone to connect without authentication.`) } const sshPath = path.join(os.homedir(), ".ssh") await fs.promises.mkdir(sshPath, { recursive: true })