Skip to content

Comments

Add Tool configuration file path as a flag#11

Open
DMarinhoCodacy wants to merge 7 commits intomainfrom
add-eslint-config-path-flag
Open

Add Tool configuration file path as a flag#11
DMarinhoCodacy wants to merge 7 commits intomainfrom
add-eslint-config-path-flag

Conversation

@DMarinhoCodacy
Copy link
Contributor

No description provided.

@codacy-production
Copy link

codacy-production bot commented Feb 6, 2026

Codacy's Analysis Summary

0 new issue (≤ 1 medium issue)
0 new security issue (≤ 0 issue)

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

@DMarinhoCodacy DMarinhoCodacy changed the title Add ESLint configuration file path as a flag Add Tool configuration file path as a flag Feb 16, 2026
codacy-production[bot]

This comment was marked as outdated.

codacy-production[bot]

This comment was marked as outdated.

codacy-production[bot]

This comment was marked as outdated.

codacy-production[bot]

This comment was marked as outdated.

Copy link

@codacy-production codacy-production bot 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

The PR introduces a new tool_config_path input to allow custom tool configurations. While the metadata and documentation are well-updated, the implementation in action.yml contains a fragile shell command that will fail if the destination directory does not exist. This needs to be addressed to ensure the action is reliable across different repository setups.

Test plan proposal

  • Verify that the action succeeds when tool_config_path is provided and points to a valid file in the repository root
  • Verify that the action succeeds when tool_config_path is not provided (default behavior remains intact)
  • Verify the action behavior when the .codacy/tools-configs/ directory does not exist before the run
  • Verify that the tool used for analysis (e.g., eslint) correctly picks up the settings from the moved configuration file
  • Verify the behavior when tool_config_path points to a file that does not exist

About this PR

  • Please provide a brief description of the PR. It's helpful to explain that this flag works by moving the configuration file to the .codacy/tools-configs/ directory, which is where the CLI expects tool-specific configurations.

💡 Codacy uses AI. Check for mistakes.

/tmp/codacy-cli-v2 init --api-token ${{inputs.api_token}} --provider ${{inputs.provider}} --organization ${{inputs.owner}} --repository ${{inputs.repository}}
fi
if [ "${{ inputs.tool_config_path }}" != "" ]; then
mv "${{ inputs.tool_config_path }}" ./.codacy/tools-configs/

Choose a reason for hiding this comment

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

🔴 HIGH RISK

The move operation assumes the destination directory ./.codacy/tools-configs/ already exists. In most fresh checkouts, this directory will be missing, causing the mv command to fail and the entire action to crash.

This might be a simple fix:

Suggested change
mv "${{ inputs.tool_config_path }}" ./.codacy/tools-configs/
mkdir -p ./.codacy/tools-configs/ && mv "${{ inputs.tool_config_path }}" ./.codacy/tools-configs/

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.

2 participants