Skip to content

Commit

Permalink
Try expression
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Oct 17, 2024
1 parent b4be705 commit 2c7460e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
KOSLI_TRAIL: ${{ github.sha }}
KOSLI_CLI_VERSION: 2.10.18
KOSLI_DRY_RUN: true # ${{ vars.KOSLI_DRY_RUN }} # false
SERVICE_NAME: dashboard


jobs:
Expand All @@ -32,7 +33,11 @@ jobs:
runs-on: ubuntu-latest
needs: [short-sha]
env:
SHORT_SHA: ${{ needs.short-sha.outputs.value }}
IMAGE_NAME: cyberdojo/${{ env.SERVICE_NAME }}:${{ needs.short-sha.outputs.value }}
outputs:
name: ${IMAGE_NAME}
tag: ${{ needs.short-sha.outputs.value }}
fingerprint: ${{ steps.variables.outputs.fingerprint }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -41,7 +46,7 @@ jobs:
- name: Do wibble
id: wibble
run:
echo "SHORT_SHA=:${SHORT_SHA}:"
echo "IMAGE_NAME=:${IMAGE_NAME}:"
exit 0

- name: Setup Kosli cli
Expand All @@ -59,15 +64,28 @@ jobs:
echo "KOSLI_COMPLIANT=:${KOSLI_COMPLIANT}:"
kosli attest generic --name=wibble
- name: Make Artifact fingerprint available to following jobs
id: variables
run: |
FINGERPRINT=ce707b630a5602097df22253e80a6305b46340b354f27776f45fc2a2688522b4
echo "fingerprint=${FINGERPRINT}" >> ${GITHUB_OUTPUT}
job-2:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
needs: [ job-1 ]
env:
IMAGE_NAME: ${{ needs.job-1.outputs.name }}
IMAGE_TAG: ${{ needs.job-1.outputs.tag }}
KOSLI_FINGERPRINT: ${{ needs.job-1.outputs.fingerprint }}
steps:
- name: step-1 from job-2
run: |
echo Hello from job-2, step-1
echo "IMAGE_NAME=:${IMAGE_NAME}:"
echo "IMAGE_TAG=:${IMAGE_TAG}:"
echo "KOSLI_FINGERPRINT=:${KOSLI_FINGERPRINT}:"
echo "TEST_UNIT_COVERAGE_IS_COMPLIANT=wibble" >> ${GITHUB_ENV}
- name: step-2 from job-2
Expand Down

0 comments on commit 2c7460e

Please sign in to comment.