Skip to content
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

Error: does not match GitHub URL pattern. Not treating it as a GitHub deploy key on version 0.9.0 #210

Open
viral1701 opened this issue Feb 23, 2024 · 9 comments

Comments

@viral1701
Copy link

Receiving error does not match the GitHub URL pattern. I am not treating it as a GitHub deploy key on v0.9.0. Using an action.yml`, there is not much going on the steps; however, it keeps failing to download the repo.

I am only downloading a single key. Below is my action.yml setup

    - name: Checkout Working Directory
      uses: actions/checkout@v4

    - name: Set up SSH agent
      uses: webfactory/[email protected]
      with:
        ssh-private-key: ${{ inputs.SSH_PRIVATE_KEY }}

@eriweb
Copy link

eriweb commented Mar 7, 2024

Have the same, did you find a solution?

@dhuseby
Copy link

dhuseby commented Apr 28, 2024

Did you generate your key with a comment that matches the other repo's url? https://github.com/webfactory/ssh-agent#support-for-github-deploy-keys

@vaherdiana
Copy link

I think the problem is here: if you adjust the regex checking for the comment of public RSA key, adding escape there, it would recognise better.
image

@sebastiankugler
Copy link
Member

@vaherdiana Thanks a lot for the analysis! Would you be able to open a PR?

@vaherdiana
Copy link

vaherdiana commented May 2, 2024

No I would not dare yet, I am trying to figure out how it works myself. Created a copy of the repo, but getting permission issues, so cant really test and I don't want to propose anything without testing. WIP :) I estimate there should be 2 groups in that regex though...

@sebastiankugler
Copy link
Member

@vaherdiana I just tested the regex myself in regex101.com. If you switch to "ECMAScript (Javascript)" you see that the / does not need to be escaped in JS.

Bildschirmfoto 2024-05-02 um 11 56 46

So I don't think that this is the cause of the problem.

@ELHart05
Copy link

After some research I used another package called appleboy/ssh-action and worked fine!

# Steps represent a sequence of tasks that will be executed as part of the job
    steps:       
    - name: Deploy using ssh
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        key: ${{ secrets.SSH_PRIVATE_KEY }}
        port: 22
        script: |
          cd /var/www/youtube.com/
          git pull origin main
          git status
          npm install --only=prod

@sbates
Copy link

sbates commented Aug 20, 2024

This regex also assumes that you are using Github.com which keeps me from being able to use this when I sync from one org to a private enterprise version :/

@malyavi-nochum
Copy link

I think Github is not keeping the comments, they seem to be stripped from the deploy keys

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

No branches or pull requests

8 participants