Skip to content

fix: fix working directory issue (DCD-5103) - #418

Merged
LukasKuzavas merged 5 commits into
developfrom
lukask/DCD-5103
Jul 27, 2026
Merged

fix: fix working directory issue (DCD-5103)#418
LukasKuzavas merged 5 commits into
developfrom
lukask/DCD-5103

Conversation

@LukasKuzavas

Copy link
Copy Markdown
Contributor

https://genesisglobal.atlassian.net/browse/DCD-5103

fix issue of sonarcloud analysis failing due to working directory resolved as with starting ././ which causes action to fail
https://github.com/genesislcap/pbi/actions/runs/30079369539?pr=2592

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hi @LukasKuzavas, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

## 📋 Review Summary

This Pull Request addresses the working directory resolution issue for SonarCloud analysis (DCD-5103) by cleanly decoupling the working-directory and server-path inputs. This resolves potential failures caused by redundant ././ prefixed directory paths when running under certain configurations. The proposed refactoring improves modularity, readability, and overall pipeline robustness.

🔍 General Feedback

  • Clean Decoupling: Excellent work separating working-directory and server-path parameters in build-gradle-g8.yml and sonarcloud.yml to prevent duplicate directory prefixes.
  • Improved Documentation: The addition of a detailed parameter description for server-path in sonarcloud.yml provides valuable clarity for workflow users.
  • Syntax Standards: Standardized newline formatting at the end of .github/workflows/sonarcloud.yml is a nice compliance touch.

env:
NODE_AUTH_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
SONAR_ARTIFACT_NAME: sonar-inputs-${{ github.run_id }}
SERVER_DIR: ${{ inputs.working-directory == '.' && inputs.server-path || format('{0}/{1}', inputs.working-directory, inputs.server-path) }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 To ensure robust handling of various inputs (such as an empty string `""` or `./` directory paths), we should extend the check for `inputs.working-directory`.

If inputs.working-directory is passed as an empty string, the expression currently falls back to format('{0}/{1}', '', 'server') which evaluates to /server (an absolute path pointing to root instead of a relative project path). Checking for empty strings and ./ will prevent this edge-case failure.

Suggested change
SERVER_DIR: ${{ inputs.working-directory == '.' && inputs.server-path || format('{0}/{1}', inputs.working-directory, inputs.server-path) }}
SERVER_DIR: ${{ (inputs.working-directory == '.' || inputs.working-directory == '' || inputs.working-directory == './') && inputs.server-path || format('{0}/{1}', inputs.working-directory, inputs.server-path) }}

perryking
perryking previously approved these changes Jul 24, 2026
@LukasKuzavas
LukasKuzavas merged commit bf65a6f into develop Jul 27, 2026
4 checks passed
@LukasKuzavas
LukasKuzavas deleted the lukask/DCD-5103 branch July 27, 2026 07:06
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.

3 participants