1616 branch :
1717 type : string
1818 required : false
19- # When using github.ref || github.head_ref, it would contain the full path, including /, which breaks the postgres hostname
20- default : ${{ github.sha }}
19+ skip_push :
20+ type : boolean
21+ required : false
22+ default : false
2123 fail_fast :
2224 type : boolean
2325 required : false
6567 - name : Checkout repository
6668 uses : actions/checkout@v4
6769 with :
68- ref : ${{ inputs.branch }}
70+ ref : ${{ inputs.branch || github.sha }}
6971 token : ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
7072
7173 - name : Checkout github-workflows repository
@@ -166,7 +168,7 @@ jobs:
166168 - name : Checkout repository
167169 uses : actions/checkout@v4
168170 with :
169- ref : ${{ inputs.branch }}
171+ ref : ${{ inputs.branch || github.sha }}
170172 token : ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
171173 # This is required such that yarn install can access private repositories, i.e. visyn_pro
172174 # https://github.com/yarnpkg/yarn/issues/2614#issuecomment-2148174789
@@ -273,6 +275,7 @@ jobs:
273275 continue-on-error : false
274276
275277 - name : Push image
278+ if : ${{ inputs.skip_push != true }}
276279 # Instead of the docker/build-push-action@v6 which will rebuild the image, just push it directly
277280 run : docker push ${{ vars.DV_AWS_ECR_REGISTRY }}/${{ matrix.component.ecr_repository }}:${{ matrix.component.image_tag }}
278281
@@ -283,6 +286,7 @@ jobs:
283286 retag-images :
284287 name : Retag images of flavor ${{ matrix.flavor || 'default' }}
285288 needs : [get-flavors, build-flavors]
289+ if : ${{ inputs.skip_push != true }}
286290 strategy :
287291 fail-fast : false
288292 matrix :
@@ -294,7 +298,7 @@ jobs:
294298 - name : Checkout repository
295299 uses : actions/checkout@v4
296300 with :
297- ref : ${{ inputs.branch }}
301+ ref : ${{ inputs.branch || github.sha }}
298302 token : ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
299303
300304 - name : Checkout github-workflows repository
@@ -342,12 +346,12 @@ jobs:
342346 push-to-repositories :
343347 name : Push images to push targets
344348 # if? When should we do this? Always? Only for certain branches? If so, how should we define that, in the config.json?
345- if : ${{ fromJson(needs.get-flavors.outputs.result).push_to != '' }}
349+ if : ${{ inputs.skip_push != true && fromJson(needs.get-flavors.outputs.result).push_to != '' }}
346350 needs : [retag-images, get-flavors]
347351 uses : datavisyn/github-workflows/.github/workflows/build-docker-artifacts-trigger-push.yml@main
348352 secrets : inherit
349353 with :
350354 push_to : ${{ fromJson(needs.get-flavors.outputs.result).push_to }}
351- branch : ${{ inputs.branch }}
355+ branch : ${{ inputs.branch || github.sha }}
352356 # Do not run this on self-hosted, as it is faster and shouldn't be blocking anything
353357 # runs_on: ${{ inputs.runs_on || 'ubuntu-22.04' }}
0 commit comments