Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit b03dad9

Browse files
Add CI workflow and scripts for template completeness check
- Enhance GitHub Actions workflow with environment variables for build and commit details. - Introduce scripts for managing Kosli trails and attestations. - Create flow configuration for artifact attestations.
1 parent 1ac82c0 commit b03dad9

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

.github/workflows/template-complete-1.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,18 @@ on:
1212

1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
15-
15+
env: # Set the secret as an input
16+
APP_NAME: ${{ github.event.repository.name }}
17+
BUILD_NUMBER: ${{ github.run_number }}
18+
GIT_REPO: ${{ github.repository }}
19+
GIT_REPO_URL: ${{ github.event.repository.clone_url }}
20+
GIT_BRANCH: ${{ github.ref_name }}
21+
GIT_COMMIT: ${{ github.sha }}
22+
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
23+
COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
24+
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_KEY }} # Set the Kosli API token as a secret in your repository
25+
KOSLI_ORG: sofusalbertsen
26+
KOSLI_FLOW: micronaut
1627
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1728
jobs:
1829
# This workflow contains a single job called "build"
@@ -24,8 +35,12 @@ jobs:
2435
steps:
2536
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2637
- uses: actions/checkout@v4
27-
38+
- name: setup-kosli-cli
39+
uses: kosli-dev/setup-cli-action@v2
40+
- name: Update Flow
41+
run: kosli create flow template-complete --description "Flow to check the template complete approach" --template-file=template-complete/kosli-config/flow.yaml
2842
# Runs a single command using the runners shell
29-
- name: Run a one-line script
43+
- name: run the scenario up
3044
run: bash template-complete/1.sh
31-
45+
- name: check-template-complete
46+
run: bash template-complete/check-template-complete.sh tempålate-complete/data.json MISSING

template-complete/1.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Get the current git commit SHA
4+
GIT_SHA=$(git rev-parse HEAD)
5+
ARTIFACT=artifact.txt
6+
# Write the SHA to artifact.txt
7+
echo "Git sha is: $GIT_SHA" > $ARTIFACT
8+
9+
kosli begin trail ${GIT_COMMIT} --description "build number ${BUILD_NUMBER}"
10+
kosli attest artifact --trail=${GIT_COMMIT} --artifact-type=file --commit-url=${COMMIT_URL} --commit=${GIT_COMMIT} $ARTIFACT --build-url=${BUILD_URL} --name=app
11+
kosli get trail -o json ${GIT_COMMIT} > data.json

template-complete/README.md

100644100755
File mode changed.

template-complete/check-template-complete.sh

100644100755
File mode changed.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 1
2+
trail:
3+
artifacts:
4+
- name: app
5+
attestations:
6+
- name: sbom
7+
type: generic
8+
- name: unit-tests
9+
type: junit
10+

0 commit comments

Comments
 (0)