action port input and outputs declarations, bump deps#53
Conversation
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
WalkthroughReplaces legacy ESLint config with a new flat config, removes Changes
Sequence Diagram(s)sequenceDiagram
participant WF as GitHub Workflow
participant Checkout as actions/checkout
participant SetupPNPM as pnpm/action-setup
participant SetupNode as actions/setup-node
participant SSH_GH as Setup GitHub SSH (id: github)
participant SSH_GL as Setup GitLab SSH (id: gitlab)
participant TestsGH as Run tests for GitHub
participant TestsGL as Run tests for GitLab
WF->>Checkout: checkout code (v5)
WF->>SetupPNPM: install pnpm (v4)
WF->>SetupNode: setup node (cache: "pnpm")
WF->>SSH_GH: setup SSH for GitHub -> outputs (ssh-path, ssh-agent-pid, ssh-auth-sock)
WF->>TestsGH: run ./test/test.sh (use SSH_GH outputs)
WF->>SSH_GL: setup SSH for GitLab (altssh.gitlab.com:443) -> outputs
WF->>TestsGL: run ./test/test.sh (use SSH_GL outputs)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/pull-request.yml (1)
53-53: Same note on pinning actions to SHAsRepeat of the earlier suggestion for checkout in the test job.
🧹 Nitpick comments (5)
eslint.config.mjs (2)
1-10: Optionally include eslint-config-prettier to avoid rule conflictsWith eslint-plugin-prettier/recommended you typically also include eslint-config-prettier to disable formatting-related ESLint rules that clash with Prettier. You already added it as a devDependency but it’s not wired here.
Apply this diff to include it:
import js from "@eslint/js"; import prettier from "eslint-plugin-prettier/recommended"; -import ts from "typescript-eslint"; +import ts from "typescript-eslint"; +import eslintConfigPrettier from "eslint-config-prettier"; export default ts.config( { ignores: ["lib/"] }, js.configs.recommended, ts.configs.recommended, + eslintConfigPrettier, prettier, );
3-3: Nit: prefer a more descriptive import nameRenaming ts to tseslint is a minor clarity win when scanning configs.
-import ts from "typescript-eslint"; +import tseslint from "typescript-eslint"; -export default ts.config( +export default tseslint.config( - ts.configs.recommended, + tseslint.configs.recommended,.github/workflows/pull-request.yml (2)
20-20: Pin actions to commit SHAs for supply-chain hardeningactions/checkout@v5 is fine functionally, but consider pinning to a specific commit SHA per security best practices to prevent tag-hijack risks.
25-25: Pin pnpm version to match packageManagerTo ensure CI uses the same pnpm version declared in package.json (pnpm@10.14.0), set it explicitly.
- name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4 + with: + version: 10.14.0package.json (1)
15-15: Nit: align main to built artifact (optional)If anyone imports this package (even if not published), main typically points to lib/index.js after ncc. Not required for GitHub Actions to function.
- "main": "src/index.ts", + "main": "lib/index.js",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
.dcignore(0 hunks).eslintignore(0 hunks).eslintrc.js(0 hunks).github/workflows/pull-request.yml(2 hunks)action.yml(2 hunks)eslint.config.mjs(1 hunks)package.json(2 hunks)
💤 Files with no reviewable changes (3)
- .dcignore
- .eslintignore
- .eslintrc.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
action.yml (3)
11-14: Correct fix: inputs must be strings in action metadataChanging the port default to the string "22" and removing a numeric type aligns with GitHub Actions input semantics (inputs are strings in action.yml). This resolves type-mismatch quirks downstream.
25-26: Post-action script presence verifiedBoth
lib/index.jsandlib/cleanup.jsare present, andpost-if: "always()"will correctly execute the cleanup step regardless of build outcome. No further changes needed.
11-14: No explicit port conversion needed for CLI flagsAll usages of the
portinput are passed directly as string arguments to CLI commands (e.g.,ssh-keyscanviaexecute("ssh-keyscan", ["-p", port, host])). Since these tools expect their flags as strings, there’s no need to convert the port to a number.Key locations:
- src/index.ts:175–176 — reading
const port: string = core.getInput("port")- src/index.ts:136–142 — calling
execute("ssh-keyscan", ["-p", port, host])No changes required.
eslint.config.mjs (1)
5-10: Flat config migration looks solidGood use of ts.config to compose js/ts recommended presets, add Prettier, and ignore lib/. This matches the tooling updates in package.json.
package.json (2)
3-3: Version bump acknowledged3.1.1 reflects the dependency upgrades and metadata fixes in this PR.
24-33: Confirm usage of eslint-config-prettierYou’ve added eslint-config-prettier but the flat config doesn’t include it. Either wire it in (see eslint.config.mjs suggestion) or drop the devDependency.
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/pull-request.yml (1)
80-83: Using altssh.gitlab.com:443 is correct; ensure known_hosts covers this hostWhen switching to altssh.gitlab.com on port 443, verify your action adds the correct host key entry for altssh.gitlab.com to known_hosts (do not disable StrictHostKeyChecking). If your action already manages known_hosts, nothing to change here.
Would you like me to propose a snippet to add/update known_hosts within the composite action for altssh.gitlab.com?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pull-request.yml(4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-12T19:36:42.818Z
Learnt from: MrSquaare
PR: MrSquaare/ssh-setup-action#53
File: .github/workflows/pull-request.yml:28-32
Timestamp: 2025-08-12T19:36:42.818Z
Learning: When using actions/setup-nodev4 with cache: "pnpm", the action automatically detects and uses pnpm-lock.yaml from the repository root by default. The cache-dependency-path parameter is only needed for non-standard lockfile locations, monorepos with multiple lockfiles, or when using wildcard patterns. For standard single-repository setups with pnpm-lock.yaml at the root, specifying cache-dependency-path is redundant and unnecessary.
Applied to files:
.github/workflows/pull-request.yml
📚 Learning: 2025-08-12T19:36:42.818Z
Learnt from: MrSquaare
PR: MrSquaare/ssh-setup-action#53
File: .github/workflows/pull-request.yml:28-32
Timestamp: 2025-08-12T19:36:42.818Z
Learning: When using actions/setup-nodev4 with cache: "pnpm", the action automatically detects and uses pnpm-lock.yaml as the cache dependency path. Adding cache-dependency-path: pnpm-lock.yaml is redundant and unnecessary.
Applied to files:
.github/workflows/pull-request.yml
🪛 actionlint (1.7.7)
.github/workflows/pull-request.yml
70-70: property "ssh-path" is not defined in object type {}
(expression)
71-71: property "ssh-agent-pid" is not defined in object type {}
(expression)
72-72: property "ssh-auth-sock" is not defined in object type {}
(expression)
94-94: property "ssh-path" is not defined in object type {}
(expression)
95-95: property "ssh-agent-pid" is not defined in object type {}
(expression)
96-96: property "ssh-auth-sock" is not defined in object type {}
(expression)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
.github/workflows/pull-request.yml (6)
20-20: Upgrade to actions/checkout@v5 looks goodv5 is stable and aligns with the rest of the workflow updates.
25-25: pnpm/action-setup@v4 is appropriatev4 supports recent pnpm versions and integrates well with setup-node caching.
31-31: Correct use of setup-node caching for pnpm (no cache-dependency-path needed)Good call keeping only cache: "pnpm". Per our retrieved learnings for this repo, setup-node@v4 auto-detects pnpm-lock.yaml at the repo root; adding cache-dependency-path would be redundant.
53-53: Upgrade to actions/checkout@v5 in test job looks goodConsistent with the build job; no issues spotted.
59-59: Adding id: github is correct and necessary for downstream outputsThis enables referencing steps.github.outputs.* in later steps.
78-78: Adding id: gitlab is correct and necessary for downstream outputsEnables steps.gitlab.outputs.* references later.
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Signed-off-by: Guillaume Bonnet <mrsquaare@mrsquaare.fr>
Summary by CodeRabbit