Skip to content

Commit

Permalink
Add optional ref parameter to cicd-docker-build-and-distribute wo…
Browse files Browse the repository at this point in the history
…rkflow.
  • Loading branch information
s3rj1k committed Jun 25, 2024
1 parent 10ccf01 commit 440a221
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/cicd-docker-build-and-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build and Distribute (via Docker)
on:
workflow_call:
inputs:
REF:
required: false
description: The branch, tag or SHA to checkout
type: string
ENVIRONMENT:
required: false
type: string
Expand Down Expand Up @@ -104,10 +108,18 @@ jobs:
id-token: write
environment: ${{ inputs.ENVIRONMENT }}
steps:

- name: Checkout code
if: ${{ inputs.REF == '' }}
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{ inputs.CODE_WORKING_DIRECTORY }}

- name: Checkout code by REF
if: ${{ inputs.REF != '' }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.REF }}
fetch-depth: 0
path: ${{ inputs.CODE_WORKING_DIRECTORY }}

Expand Down

0 comments on commit 440a221

Please sign in to comment.