diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b445cd3..aaeb8a2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,8 @@ jobs: build: needs: [tests, type-check] uses: ./.github/workflows/build.yml + with: + artifact-name: "lib-${{ github.head_ref }}" build-storybook: needs: [tests, type-check] uses: ./.github/workflows/build-storybook.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a13fbdf..2997a10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,21 @@ name: 'Build' -on: [workflow_call, workflow_dispatch] +on: + workflow_call: + inputs: + artifact-name: + description: name of the artifact to be pushed + required: true + type: string + workflow_dispatch: + inputs: + artifact-name: + description: name of the artifact to be pushed + required: false + type: string + +env: + ARTIFACT_NAME: ${{ inputs.artifact-name || format('lib-{0}', github.sha) }} jobs: build: @@ -22,6 +37,6 @@ jobs: uses: actions/upload-artifact@v4 with: # TODO (GAFI 19-03-2024): Add variable for this to avoid using ref when not provided - name: lib-${{ github.head_ref }} + name: ${{ env.ARTIFACT_NAME }} path: ./dist if-no-files-found: error