diff --git a/lib/manager/github-actions/__fixtures__/workflow.yml.1 b/lib/manager/github-actions/__fixtures__/workflow.yml.1 index 1513408eee8107e9230687bc72c7e5f1efcf2e34..cf92d10e68938141696ccaa3a40eef17d1e6eb22 100644 --- a/lib/manager/github-actions/__fixtures__/workflow.yml.1 +++ b/lib/manager/github-actions/__fixtures__/workflow.yml.1 @@ -30,3 +30,8 @@ jobs: steps: - name: Node 6 test uses: docker://node:6@sha256:7b65413af120ec5328077775022c78101f103258a1876ec2f83890bce416e896 + container_image_test: + name: Container Image Test + runs-on: ubuntu-latest + container: + image: hadolint/hadolint:v1.0.0-alpine diff --git a/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap b/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap index 5619b6bc76e57daab768fe65a166074581da44df..e302addf492538ec685194ff069b54abbedae7e5 100644 --- a/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap +++ b/lib/manager/github-actions/__snapshots__/extract.spec.ts.snap @@ -76,5 +76,14 @@ Array [ "replaceString": "node:6@sha256:7b65413af120ec5328077775022c78101f103258a1876ec2f83890bce416e896", "versioning": "docker", }, + Object { + "autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}", + "currentDigest": undefined, + "currentValue": "v1.0.0-alpine", + "datasource": "docker", + "depName": "hadolint/hadolint", + "depType": "docker", + "replaceString": "hadolint/hadolint:v1.0.0-alpine", + }, ] `; diff --git a/lib/manager/github-actions/extract.spec.ts b/lib/manager/github-actions/extract.spec.ts index 4b5b6f0a6140df2e1357d33e43f168abc5db873e..7d7675f51b0a46e5b74a411fd630c25c4194b0d5 100644 --- a/lib/manager/github-actions/extract.spec.ts +++ b/lib/manager/github-actions/extract.spec.ts @@ -19,7 +19,7 @@ describe('lib/manager/github-actions/extract', () => { it('extracts multiple docker image lines from yaml configuration file', () => { const res = extractPackageFile(workflow1); expect(res.deps).toMatchSnapshot(); - expect(res.deps.filter((d) => d.datasource === 'docker')).toHaveLength(2); + expect(res.deps.filter((d) => d.datasource === 'docker')).toHaveLength(3); }); it('extracts multiple action tag lines from yaml configuration file', () => { const res = extractPackageFile(workflow2); diff --git a/lib/manager/github-actions/extract.ts b/lib/manager/github-actions/extract.ts index 3608ad6a93597a50a3c4e90567be738f8fecc935..6f154e84d02d8b28386ce6178b9d5d48bb752266 100644 --- a/lib/manager/github-actions/extract.ts +++ b/lib/manager/github-actions/extract.ts @@ -13,6 +13,15 @@ export function extractPackageFile(content: string): PackageFile | null { continue; // eslint-disable-line no-continue } + const containerImageMatch = /^\s+image: ([^"]+)\s*$/.exec(line); + if (containerImageMatch) { + const [, currentFrom] = containerImageMatch; + const dep = getDep(currentFrom); + dep.depType = 'docker'; + deps.push(dep); + continue; // eslint-disable-line no-continue + } + const dockerMatch = /^\s+uses: docker:\/\/([^"]+)\s*$/.exec(line); if (dockerMatch) { const [, currentFrom] = dockerMatch;