Skip to content

Commit

Permalink
Try supporting tags with SHAs
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Dec 7, 2022
1 parent 8851eca commit b6032e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/docker-tags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {getImageName} from '../src/update-containers'
describe('Docker tags', () => {
test('UPDATER_IMAGE_NAME uses a pinned version and matches the config Dockerfile', () => {
expect(UPDATER_IMAGE_NAME).toMatch(
/^ghcr\.io\/dependabot\/dependabot-updater@sha256:[a-zA-Z0-9]{64}$/
/^ghcr\.io\/dependabot\/dependabot-updater:v\d.\d.\d{14}@sha256:[a-zA-Z0-9]{64}$/
)

expect(UPDATER_IMAGE_NAME).toEqual(getImageName('Dockerfile.updater'))
Expand Down
2 changes: 1 addition & 1 deletion docker/containers.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"proxy": "ghcr.io/github/dependabot-update-job-proxy/dependabot-update-job-proxy@sha256:1942aea0f57a3652d7694390dd4d8e6d08abca84b89383ee7ef9c6b57e00d247",
"updater": "ghcr.io/dependabot/dependabot-updater@sha256:6030d5a8cd23246af8fc0276c906316fbd166d7a400479b1b87589aea7abcac9"
"updater": "ghcr.io/dependabot/dependabot-updater:v2.0.20221206153122@sha256:6030d5a8cd23246af8fc0276c906316fbd166d7a400479b1b87589aea7abcac9"
}
2 changes: 1 addition & 1 deletion src/docker-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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}))?$'
'^(?<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)
Expand Down

0 comments on commit b6032e8

Please sign in to comment.