From 0f7930d8085ced4a7bc583c681f5a291b89b99ec Mon Sep 17 00:00:00 2001 From: Barry Gordon Date: Tue, 22 Feb 2022 17:14:22 +0000 Subject: [PATCH] Ingest the docker/containers.json config --- Dockerfile | 5 ----- src/docker-tags.ts | 28 +++------------------------- tsconfig.json | 3 ++- 3 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 06e9834..0000000 --- a/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -# NOTE: This Dockerfile is unused, it's only here so Dependabot can update the sha's - -# TODO: Pin to sha256 -FROM docker.pkg.github.com/dependabot/dependabot-updater:v1 -FROM docker.pkg.github.com/github/dependabot-update-job-proxy:v1 diff --git a/src/docker-tags.ts b/src/docker-tags.ts index b41fdf7..c502db0 100644 --- a/src/docker-tags.ts +++ b/src/docker-tags.ts @@ -1,26 +1,4 @@ -import fs from 'fs' +import dockerContainerConfig from '../docker/containers.json' -const dockerfile = fs.readFileSync(require.resolve('../Dockerfile'), 'utf8') - -const imageNames = dockerfile - .split(/\n/) - .filter(a => a.startsWith('FROM')) - .map(a => a.replace('FROM', '').trim()) - -const updaterImageName = imageNames.find(a => - a.includes('dependabot/dependabot-updater') -) -const proxyImageName = imageNames.find(a => - a.includes('github/dependabot-update-job-proxy') -) - -if (!updaterImageName) { - throw new Error('Could not find dependabot-updater image name') -} - -if (!proxyImageName) { - throw new Error('Could not find dependabot-update-job-proxy image name') -} - -export const UPDATER_IMAGE_NAME = updaterImageName -export const PROXY_IMAGE_NAME = proxyImageName +export const UPDATER_IMAGE_NAME = dockerContainerConfig.updater +export const PROXY_IMAGE_NAME = dockerContainerConfig.proxy diff --git a/tsconfig.json b/tsconfig.json index 9fba856..27f69e1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ "moduleResolution": "node", "noEmit": true, /* Do not emit compiler output files as we use ncc to package the action */ - "forceConsistentCasingInFileNames": true /* Error if requiring a file by a casing different from the casing on disk */ + "forceConsistentCasingInFileNames": true, /* Error if requiring a file by a casing different from the casing on disk */ + "resolveJsonModule": true }, "include": ["src/**/*.ts"], "exclude": ["**/node_modules/**"]