Skip to content

Commit

Permalink
Do minimal example
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <[email protected]>
  • Loading branch information
jparisu committed May 11, 2023
1 parent d8aeb96 commit 5a1c3f7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/actions/action_with_output/action.yml
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
2 changes: 0 additions & 2 deletions ubuntu/check_version_update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a1c3f7

Please sign in to comment.