Skip to content

Add option to set ssh port for servers using non-standard SSH port #997

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romainreignier
Copy link
Contributor

Hi dear maintainers,

I know that this action has been developed exclusively to be used on Github.
But other forges like Forgejo provide actions runners compatible with the Github ones.
I have been able to use your action on a private Forgejo instance but on my server, the SSH port of the Git server is not the default port 22. Hence my rosinstall files contains ssh urls with a specific port, in the format:

ssh://git@domain_name.com:port/org/repo.git

instead of the Github:

[email protected]:org/repo.git

By adding the ssh-port input for the action, I have managed to adapt the url replaced with the insteaof git config to make it work for my use-case.

Because the git url with a port has already a trailing / like on HTTPS urls, the config entry is the same, hence the --add argument in that case.

I have not added an entry in the README because this is an advanced usage of the action and it is documented in action.yml.

I have been able to test this change both on my private Forgejo setup and on Github with a private repo with ssh url in the rosinstall.

@romainreignier romainreignier requested a review from a team as a code owner July 1, 2025 10:34
@romainreignier romainreignier requested review from emersonknapp and MichaelOrlov and removed request for a team July 1, 2025 10:34
@romainreignier romainreignier force-pushed the feature/ssh_port branch 2 times, most recently from 2dbc144 to 22eada6 Compare July 1, 2025 12:30
@romainreignier romainreignier marked this pull request as draft July 1, 2025 14:18
@romainreignier romainreignier marked this pull request as ready for review July 1, 2025 15:18
@christophebedard christophebedard self-requested a review July 2, 2025 23:25
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 24.84%. Comparing base (8948ee7) to head (316520d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/action-ros-ci.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #997      +/-   ##
==========================================
- Coverage   25.15%   24.84%   -0.31%     
==========================================
  Files           2        2              
  Lines         322      326       +4     
  Branches       86       88       +2     
==========================================
  Hits           81       81              
- Misses        241      245       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. I just have a minor request.

@@ -118,6 +118,13 @@ inputs:
Scheduled events default to latest commit of default branch.
Set this if you want the scheduled job to run on on a specific branch.
required: false
ssh-port:
Copy link
Member

Choose a reason for hiding this comment

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

I think git-ssh-port would be a bit more descriptive, for the input name here and for the variable (gitSshPort) in src/action-ros-ci.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems a good idea.
I won't be able to make the change this week but will try I soon as I can or feel free to do it.

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