Open dieselburner opened 1 year ago
I have the same problem
Hi, I have/had the same problem, but was able to fix it with a small hack: In a prior step I modify the ssh config to add a custom port. This is the config for that step.
Note: I'm using this on a gitea/act runner (running ubuntu:latest) so you might have to adjust it a little bit (e.g. paths). I also only tested it with v3, not any older or newer tags like v2 and v4.
- name: Git Setup
run: |
mkdir -p ~/.ssh
echo 'Host your_host_url ' >> ~/.ssh/config
echo ' HostName your_host_url' >> ~/.ssh/config
echo ' Port your_port' >> ~/.ssh/config
cat ~/.ssh/config
To use this, you have to replace your_host_url
and your_port
with, well, your host url and port respectively.
You could use this to also change the user using echo ' User your_user' >> ~/.ssh/config
or any other settings that can be modified in a ssh config.
Explanation: mkdir
makes sure that the folder .ssh exists. The echo
commands append the needed config to the config file. If none exists it will be created automatically. cat
prints the contents of the config file for verification. This last command can be left out.
Thank you, @freeware-superman!
With your suggestion, the checkout v4 action can be successfully run on my self-hosted Gitea instance. Here is my minimal workflow configuration. I hope this helps someone.
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Git Setup
run: |
mkdir -p ~/.ssh
echo 'Host gitea.local' >> ~/.ssh/config
echo ' HostName <gitea_ip>' >> ~/.ssh/config
echo ' Port <gitea_ssh_port>' >> ~/.ssh/config
cat ~/.ssh/config
- name: Check out repository code
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
github-server-url: 'http://gitea.local'
ssh-known-hosts: ${{ vars.SSH_KNOWN_HOSTS }}
Pre-requirements:
DEPLOY_KEY
.SSH_KNOWN_HOSTS
. This prevents the SSH host key verification failed error.I don't believe GHES allows changing the SSH Port - https://docs.github.com/en/enterprise-server@3.10/admin/configuring-settings/configuring-network-settings/network-ports#application-ports-for-end-users
We aren't able to support other git providers with this action at this time. We don't test compatibility with third-party solutions and thus can't maintain or support any features created exclusively for those third-parties. https://github.com/actions/checkout/issues/1242#issuecomment-1773409781
Seems like
github-server-url
is dropping custom SSH port, while URL is valid:Excerpt from logs: