From cb0f88a965d201276d5cfce24d66fe1e2298da0d Mon Sep 17 00:00:00 2001 From: kifir Date: Sat, 6 Jul 2024 22:59:29 +0300 Subject: [PATCH] Support storing GHA outputs in specified .properties file --- .../workflows/custom-board-build/action.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/custom-board-build/action.yaml b/.github/workflows/custom-board-build/action.yaml index b41a7ade59..ad1f95d790 100644 --- a/.github/workflows/custom-board-build/action.yaml +++ b/.github/workflows/custom-board-build/action.yaml @@ -79,6 +79,10 @@ inputs: required: false EXTRA_LIVE_DATA_FILE: required: false + gha_outputs_file: + description: '.properties file to store GHA outputs (unfortunately GGA outputs do not work for nested GHA - see https://github.com/actions/runner/issues/2009#issuecomment-1793565031)' + required: false + default: 'false' runs: using: "composite" @@ -160,6 +164,7 @@ runs: echo "white_label=$(bash ${{inputs.rusefi_dir}}/firmware/bin/find_white_label.sh shared_io.resources/shared_io.properties)" >> $GITHUB_OUTPUT - name: Set Env Variables + id: set-env-variables shell: bash run: | : Set Env Variables @@ -534,3 +539,17 @@ runs: run: | : Upload Obfuscated Tagged Daily Release Bundle bash ../firmware/bin/upload_bundle.sh ${{ inputs.RUSEFI_OBFUSCATED_PUBLIC_SSH_USER }} "${{ inputs.RUSEFI_OBFUSCATED_PUBLIC_SSH_PASS }}" ${{ inputs.RUSEFI_OBFUSCATED_PUBLIC_SSH_SERVER }} "${{env.SHORT_BOARD_NAME}}_obfuscated_public" ${{ inputs.new_tag }} + + - name: Create .properties file for action outputs + if: ${{ inputs.gha_outputs_file != ''}} + uses: 1arp/create-a-file-action@0.4.5 + with: + file: ${{ inputs.gha_outputs_file }} + + - name: Populate .properties file with action outputs + if: ${{ inputs.gha_outputs_file != ''}} + uses: kurt-code/gha-properties@v0.0.2 + with: + operation: 'write' + file-path: ${{ inputs.gha_outputs_file }} + key-value-pairs: '{"white_label": "${{ steps.find-out-white-label.outputs.white_label }}", "short_board_name": "${{ steps.set-env-variables.outputs.short_board_name }}", "new_tag": "${{ steps.tag.outputs.new_tag }}"}' \ No newline at end of file