From 5a1c3f7b1052f49637157a5245529e37a2e83c69 Mon Sep 17 00:00:00 2001 From: jparisu Date: Thu, 11 May 2023 10:09:17 +0200 Subject: [PATCH] Do minimal example Signed-off-by: jparisu --- .github/actions/action_with_output/action.yml | 14 +++++ .github/workflows/pr_test.yml | 53 +++++++++++++++++++ ubuntu/check_version_update/action.yml | 2 - 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 .github/actions/action_with_output/action.yml diff --git a/.github/actions/action_with_output/action.yml b/.github/actions/action_with_output/action.yml new file mode 100644 index 00000000..29b36040 --- /dev/null +++ b/.github/actions/action_with_output/action.yml @@ -0,0 +1,14 @@ +name: action_with_output + +outputs: + out: + description: 'Some output' + value: ${{ steps.run.outputs.out }} + +runs: + using: composite + steps: + - name: action with output step + id: run + shell: bash + run: echo "out=true" >> $GITHUB_OUTPUT diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index e8f92d78..468eb2c9 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -66,3 +66,56 @@ jobs: echo "Version file ${{ inputs.version-file-path }} updated." echo "HURRAY! ^.^" fi + + + testing2: + runs-on: ubuntu-22.04 + outputs: + out1: ${{ steps.action1.outputs.out }} + out2: ${{ steps.action2.outputs.out }} + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@feature/versions-update + with: + path: src + + - name: Run some action with output + id: action1 + uses: ./src/.github/actions/action_with_output + + - name: Run some shell with output + id: action2 + shell: bash + run: echo "out=true" >> $GITHUB_OUTPUT + + - name: Get output 1 + shell: bash + run: echo "OUTPUT ${{ steps.action1.outputs.out }}" + + - name: Get output 2 + if: ${{ steps.action1.outputs.out }} == true + shell: bash + run: echo "OUTPUT true" + + - name: Get output 3 + if: ${{ steps.action1.outputs.out }} != true + shell: bash + run: echo "OUTPUT diff true" + + - name: Get output 4 + shell: bash + run: echo "OUTPUT ${{ steps.action2.outputs.out }}" + + testing3: + runs-on: ubuntu-22.04 + needs: [testing2] + steps: + + - name: Get output from other job + shell: bash + run: echo "OUTPUT ${{ steps.testing2.outputs.out1 }}" + + - name: Get output from other job + shell: bash + run: echo "OUTPUT ${{ steps.testing2.outputs.out2 }}" diff --git a/ubuntu/check_version_update/action.yml b/ubuntu/check_version_update/action.yml index 354e685d..2b0ee447 100644 --- a/ubuntu/check_version_update/action.yml +++ b/ubuntu/check_version_update/action.yml @@ -60,8 +60,6 @@ runs: uses: eProsima/eProsima-CI/ubuntu/git_diff@feature/versions-update with: file-path: ${{ github.workspace }}/${{ inputs.version-file-path }} - outputs: - have-changes: ${{ steps.diff2.outputs.have-changes }} - name: get_git_diff_files id: diff1