From e242ed82be6c2d04e281e6bc0ed2c93a4dff7ae3 Mon Sep 17 00:00:00 2001 From: Simon Templer Date: Tue, 19 Nov 2024 11:00:19 +0100 Subject: [PATCH] feat(dockerfile): support passing in custom checkout ref --- .github/workflows/dockerfile-build.yml | 5 +++++ .github/workflows/dockerfile-publish.yml | 5 +++++ .github/workflows/dockerfile.yml | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/dockerfile-build.yml b/.github/workflows/dockerfile-build.yml index 0fdd5c4..7f91ac4 100644 --- a/.github/workflows/dockerfile-build.yml +++ b/.github/workflows/dockerfile-build.yml @@ -13,6 +13,10 @@ on: description: Docker build context type: string default: . + checkout-ref: + description: Custom ref to check out + type: string + default: '' secrets: DOCKER_HUB_USERNAME: DOCKER_HUB_PASSWORD: @@ -24,6 +28,7 @@ jobs: image: ${{ inputs.image }} tag: ${{ inputs.tag }} context: ${{ inputs.context }} + checkout-ref: ${{ inputs.checkout-ref }} push: false notify-failure: false secrets: inherit diff --git a/.github/workflows/dockerfile-publish.yml b/.github/workflows/dockerfile-publish.yml index e1e6988..93646e0 100644 --- a/.github/workflows/dockerfile-publish.yml +++ b/.github/workflows/dockerfile-publish.yml @@ -13,6 +13,10 @@ on: description: Docker build context type: string default: . + checkout-ref: + description: Custom ref to check out + type: string + default: '' secrets: DOCKER_HUB_USERNAME: required: true @@ -28,6 +32,7 @@ jobs: image: ${{ inputs.image }} tag: ${{ inputs.tag }} context: ${{ inputs.context }} + checkout-ref: ${{ inputs.checkout-ref }} push: true notify-failure: true secrets: inherit diff --git a/.github/workflows/dockerfile.yml b/.github/workflows/dockerfile.yml index 6610af2..978a4f4 100644 --- a/.github/workflows/dockerfile.yml +++ b/.github/workflows/dockerfile.yml @@ -21,6 +21,10 @@ on: description: Docker build context type: string default: . + checkout-ref: + description: Custom ref to check out + type: string + default: '' secrets: DOCKER_HUB_USERNAME: DOCKER_HUB_PASSWORD: @@ -31,6 +35,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ inputs.checkout-ref }} - name: Docker meta id: meta