diff --git a/.github/workflows/reusable-generate-metadata.yml b/.github/workflows/reusable-generate-metadata.yml index 63ff2aec..65c4f820 100644 --- a/.github/workflows/reusable-generate-metadata.yml +++ b/.github/workflows/reusable-generate-metadata.yml @@ -51,10 +51,13 @@ jobs: image-registry: ${{ inputs.image-registry }} image-name: ${{ inputs.image-name }} build-args: ${{ steps.set-metadata.outputs.BUILD_ARGS }} - tags: ${{ steps.generate-tags.outputs.TAGS }} + tags: ${{ steps.set-metadata.outputs.TAGS }} steps: - name: Fetch Kernel Version id: fetch-kernel-version + env: + IMAGE_REGISTRY: ${{ inputs.image-registry }} + FEDORA_VERSION: ${{ inputs.fedora-version }} run: | KERNEL_VERSION=$(skopeo inspect docker://${IMAGE_REGISTRY}/main-kernel:${FEDORA_VERSION} | jq -r '.Labels["ostree.linux"]') @@ -66,6 +69,7 @@ jobs: IS_LATEST_VERSION: ${{ inputs.is-latest }} IS_GTS_VERSION: ${{ inputs.is-gts }} IS_BETA_VERSION: ${{ inputs.is-beta }} + FEDORA_VERSION: ${{ inputs.fedora-version }} run: | TIMESTAMP="$(date +%Y%m%d)" SHA_SHORT="${GITHUB_SHA::7}" @@ -89,3 +93,28 @@ jobs: done echo "TAGS=$(IFS=,; echo "${TAGS[*]}")" >> $GITHUB_OUTPUT + + - name: Generate Build Args + id: generate-build-args + env: + KERNEL_VERSION: ${{ steps.fetch-kernel-version.outputs.KERNEL_VERSION }} + FEDORA_VERSION: ${{ inputs.fedora-version }} + IMAGE_NAME: ${{ inputs.image-name }} + run: | + BUILD_ARGS=() + + BUILD_ARGS+=("KERNEL_VERSION=${KERNEL_VERSION}") + BUILD_ARGS+=("SOURCE_IMAGE=${SOURCE_IMAGE}") + BUILD_ARGS+=("FEDORA_MAJOR_VERSION=${FEDORA_VERSION}") + BUILD_ARGS+=("IMAGE_NAME=${IMAGE_NAME}") + + echo "BUILD_ARGS=$(IFS=,; echo "${BUILD_ARGS[*]}")" >> $GITHUB_OUTPUT + + - name: Set Metadata + id: set-metadata + env: + BUILD_ARGS: ${{ steps.generate-build-args.outputs.BUILD_ARGS }} + TAGS: ${{ steps.generate-tags.outputs.TAGS }} + run: | + echo "BUILD_ARGS=${BUILD_ARGS}" >> $GITHUB_OUTPUT + echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT