7272 id-token : write
7373 outputs :
7474 registry : ${{ steps.login-ecr.outputs.registry }}
75- env :
76- LICENSE : ${{ secrets.LICENSE }}
7775 steps :
7876 - name : Checkout
7977 uses : actions/checkout@v4
@@ -117,18 +115,19 @@ jobs:
117115 if [ -n "${{ secrets.LICENSE }}" ]; then
118116 echo "${{ secrets.LICENSE }}" > dist/LICENSE.txt
119117 echo "License file created at dist/LICENSE.txt"
118+ echo "target=with-licence" >> $GITHUB_OUTPUT
120119 else
121120 echo "LICENSE_TEXT secret not provided. Skipping license file creation."
122121 fi
123122
124123
125124 - name : Build and push with licence
126- if : ${{ env .LICENSE != '' }}
125+ if : ${{ secrets .LICENSE != '' }}
127126 uses : docker/build-push-action@v6
128127 with :
129128 file : ${{ inputs.build-file || 'Dockerfile' }}
130129 context : ${{ inputs.build-context || '.'}}
131- target : with- license
130+ target : ${{ steps. license.outputs.target }}
132131 push : ${{ inputs.build-push }}
133132 provenance : false
134133 tags : ${{ steps.meta.outputs.tags }}
@@ -140,7 +139,7 @@ jobs:
140139 secrets : ${{ secrets.build-secrets }}
141140
142141 - name : Build and push without licence
143- if : ${{ env .LICENSE != '' }}
142+ if : ${{ secrets .LICENSE != '' }}
144143 uses : docker/build-push-action@v6
145144 with :
146145 file : ${{ inputs.build-file || 'Dockerfile' }}
0 commit comments