Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Set path for CJS actions on Windows #172

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
Mar 28, 2025
Merged

Set path for CJS actions on Windows #172

merged 1 commit into from
Mar 28, 2025

Conversation

ncalteen
Copy link
Collaborator

When running @github/local-action on CommonJS actions on Windows, the entrypoint should not include a leading slash. ESM actions however, appear to require this.

@ncalteen ncalteen self-assigned this Mar 28, 2025
@Copilot Copilot AI review requested due to automatic review settings March 28, 2025 14:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adjusts how the entrypoint path is constructed for CommonJS and ESM actions on Windows.

  • Introduces a conditional that prepends a leading slash only for ESM actions
  • Retains the previous behavior for CommonJS actions by replacing Windows path separators with '/'
Comments suppressed due to low confidence (1)

src/commands/run.ts:289

  • In the ESM branch, the path is not normalized (i.e., replacing Windows path separators with '/'). This may cause issues if path.resolve returns paths with backslashes on Windows. Consider applying the same normalization as in the CommonJS branch if needed, or add a clarifying comment as to why it is intentionally omitted.
actionType === 'esm'

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

Copy link

πŸ¦™ MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
βœ… ACTION actionlint 4 0 0 0.15s
βœ… JAVASCRIPT prettier 11 0 0 0.99s
βœ… JSON npm-package-json-lint yes no no 1.03s
βœ… JSON prettier 26 0 0 1.57s
βœ… MARKDOWN markdownlint 9 0 0 3.33s
βœ… REPOSITORY checkov yes no no 26.47s
βœ… REPOSITORY gitleaks yes no no 1.28s
βœ… REPOSITORY git_diff yes no no 0.01s
βœ… REPOSITORY grype yes no no 41.43s
βœ… REPOSITORY secretlint yes no no 1.09s
βœ… REPOSITORY syft yes no no 9.88s
❌ REPOSITORY trivy yes 1 no 12.46s
βœ… REPOSITORY trivy-sbom yes no no 1.61s
βœ… REPOSITORY trufflehog yes no no 27.06s
βœ… TYPESCRIPT prettier 71 0 0 2.62s
βœ… YAML prettier 22 0 0 0.84s
βœ… YAML yamllint 22 0 0 0.5s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@ncalteen ncalteen merged commit 8f13ccd into main Mar 28, 2025
8 of 9 checks passed
@ncalteen ncalteen deleted the ncalteen/cjs branch March 28, 2025 14:49
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.

1 participant