Skip to content

Custom Flavor builds using SSH remotes fail #6511

@mckraken

Description

@mckraken

Describe the bug
When using the custom flavor generator (https://megalinter.io/latest/custom-flavors/) if the repository is cloned using SSH, the megalinter action fails as [email protected]: is pre-pended when pulling the image:

Pull down action image 'ghcr.io/[email protected]:{user/org}/{repo}/megalinter-custom-flavor:latest'
  /usr/bin/docker pull ghcr.io/[email protected]:{user/org}/{repo}/megalinter-custom-flavor:latest
  invalid reference format
  Warning: Docker pull failed with exit code 1, back off 7.015 seconds before retry.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the steps in the referenced page, but clone it with SSH and have the git remote origin be an ssh url:
$ git remote -v
origin  [email protected]:<org>/<repo>.git
  1. Go through the rest of the process. The README.md with show the following:
- GitHub Action: On MegaLinter step in .github/workflows/mega-linter.yml, define `uses: [email protected]:{user/org}/{repo}@main`
  1. Even if omitting the [email protected]: from the uses: line when setting up the action, the docker pull command will still use it and present the error/failure above in the github action.

Expected behavior
That even if using SSH keys to clone a repo, the custom flavor should still work and omit the [email protected]: from the docker pull and README.md file.

Additional context

I greatly appreciate the new option to build our own custom flavors! Thank you for this option!
It's just that our standard is to use SSH for git remotes. Once I reset the repo remote origin to use HTTPS and reran the npx mega-linter-runner --custom-flavor-setup command I was able to get it to work, but it should work for SSH remotes as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions