From 91534274d8666a206d16522a7430b9066b2d2b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Correa=20Rodr=C3=ADguez?= Date: Tue, 24 Sep 2024 17:10:19 +0200 Subject: [PATCH] Added checksum logic --- .github/workflows/builder_OVA.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builder_OVA.yaml b/.github/workflows/builder_OVA.yaml index bd11bc3..b315bae 100644 --- a/.github/workflows/builder_OVA.yaml +++ b/.github/workflows/builder_OVA.yaml @@ -1,4 +1,4 @@ -run-name: Build OVA ${{ inputs.is_stage && ' - is stage' || '' }} ${{ inputs.id }} - Wazuh virtual machines branch ${{ github.ref_name }} - Launched by @${{ github.actor }} +run-name: Build OVA ${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} ${{ inputs.id }} - Wazuh virtual machines branch ${{ github.ref_name }} - Launched by @${{ github.actor }} name: Build OVA on: @@ -29,6 +29,12 @@ on: description: "Is stage?" type: boolean default: false + checksum: + type: boolean + description: | + Generate package checksum. + Default is 'false'. + required: false DEBUG: type: choice description: 'Debug mode' @@ -42,6 +48,9 @@ on: id: type: string required: false + checksum: + type: boolean + required: false env: OVA_AMI: "ami-0d4bd55523ee67aa4" @@ -222,6 +231,7 @@ jobs: aws s3 cp --quiet --acl public-read /tmp/${{ env.FILENAME_OVA }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.FILENAME_OVA }} - name: Generating sha512 file + if: ${{ inputs.checksum == true }} run: | sha512sum /tmp/${{ env.FILENAME_OVA }} > /tmp/${{ env.FILENAME_SHA }} aws s3 cp --quiet --acl public-read /tmp/${{ env.FILENAME_SHA }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.FILENAME_SHA }}