Skip to content

Commit e3050f2

Browse files
authored
Renamed artifacts OPS-3 (#3)
1 parent bf6475b commit e3050f2

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/workflows/build-backend.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build Backend
33
on:
44
push:
55
paths: ["apps/backend/**", ".github/workflows/build-backend.yml"]
6-
workflow_dispatch:
76

87
env:
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:

.github/workflows/build-frontend.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build Frontend
33
on:
44
push:
55
paths: ["apps/frontend/**", ".github/workflows/build-frontend.yml"]
6-
workflow_dispatch:
76

87
env:
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:

.github/workflows/composites/kosli-attest-dir-artifact/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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"
@@ -58,6 +58,6 @@ runs:
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 }}

0 commit comments

Comments
 (0)