Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
dependabot-action/src/docker-tags.ts
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore import/extensions when importing Docker tags JSON
18 lines (14 sloc)
610 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line import/extensions | |
import dockerContainerConfig from '../docker/containers.json' | |
export const UPDATER_IMAGE_NAME = dockerContainerConfig.updater | |
export const PROXY_IMAGE_NAME = dockerContainerConfig.proxy | |
const imageNamePattern = | |
'^(?<repository>(([a-zA-Z0-9._-]+([:[0-9]+[^/]))?([a-zA-Z0-9._/-]+)?))((:[a-zA-Z0-9._/-]+)|(@sha256:[a-zA-Z0-9]{64}))?$' | |
export function repositoryName(imageName: string): string { | |
const match = imageName.match(imageNamePattern) | |
if (match?.groups) { | |
return match.groups['repository'] | |
} else { | |
throw Error('invalid image name') | |
} | |
} |