File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
composites/kosli-attest-dir-artifact Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ name: Build Backend
33on :
44 push :
55 paths : ["apps/backend/**", ".github/workflows/build-backend.yml"]
6- workflow_dispatch :
76
87env :
98 # kosli commands picks up org, flow, trail and api-token from these environment variables
@@ -74,13 +73,16 @@ jobs:
7473 - name : Build backend
7574 run : echo "Here we could do some proper build"
7675
76+ - name : Extract short SHA
77+ run : echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
78+
7779 - name : Attest artifact
7880 id : calculate_fingerprint
7981 if : ${{ github.ref == 'refs/heads/main' }}
8082 uses : ./.github/workflows/composites/kosli-attest-dir-artifact
8183 with :
8284 kosli-artifact-template-name : backend
83- artifact-env- name : backend0001
85+ artifact-name : backend:${{ env.SHORT_SHA }}
8486 artifact-dir : apps/backend
8587
8688 assert-artifacts :
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ name: Build Frontend
33on :
44 push :
55 paths : ["apps/frontend/**", ".github/workflows/build-frontend.yml"]
6- workflow_dispatch :
76
87env :
98 # kosli commands picks up org, flow, trail and api-token from these environment variables
@@ -74,13 +73,16 @@ jobs:
7473 - name : Build frontend
7574 run : echo "Here we could do some proper build"
7675
76+ - name : Extract short SHA
77+ run : echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
78+
7779 - name : Attest artifact
7880 id : calculate_fingerprint
7981 if : ${{ github.ref == 'refs/heads/main' }}
8082 uses : ./.github/workflows/composites/kosli-attest-dir-artifact
8183 with :
8284 kosli-artifact-template-name : frontend
83- artifact-env- name : frontend0002
85+ artifact-name : frontend:${{ env.SHORT_SHA }}
8486 artifact-dir : apps/frontend
8587
8688 assert-artifacts :
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ inputs:
1717 kosli-artifact-template-name :
1818 description : " Name of the artifact in kosli template-file. Often something generic like 'frontend'"
1919 required : true
20- artifact-env- name :
21- description : " Name of the artifact used when running in an environment. Often something like 'wezzajjgadwa0005' "
20+ artifact-name :
21+ description : " Name of this artifact in this build (frontend:b439987) "
2222 required : true
2323 artifact-dir :
2424 description : " Directory where artifact is stored"
5858 shell : bash
5959 run : |
6060 set -x
61- kosli attest artifact ${{ inputs.artifact-env- name }} \
61+ kosli attest artifact ${{ inputs.artifact-name }} \
6262 --name ${{ inputs.kosli-artifact-template-name }} \
6363 --fingerprint ${{ env.KOSLI_FINGERPRINT }}
You can’t perform that action at this time.
0 commit comments