Skip to content

Commit

Permalink
modify set-output for github output
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 925889f commit 3923a64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 7 additions & 3 deletions ubuntu/check_version_update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ runs:
file-path: ${{ github.workspace }}/${{ inputs.version-file-path }}

- name: Check if file change
if: ${{ steps.git-diff.outputs.have-changes == 'false' }}
shell: bash
run: |
echo "Version file ${{ inputs.version-file-path }} has not been updated."
exit 1
if [[ "${{ steps.git-diff.outputs.have-changes }}" == 'false' ]]; then
echo "Version file ${{ inputs.version-file-path }} has not been updated."
exit 1
else
echo "Version file Updated. HURRAY!"
fi
11 changes: 7 additions & 4 deletions ubuntu/git_diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ inputs:
result-file:
description: Additional arguments to pass to the git diff command
required: false
default: '${{ github.workspace }}/git.diff'
default: ${{ github.workspace }}/git.diff

outputs:

Expand All @@ -49,14 +49,17 @@ runs:
if [ -s "${{ inputs.result-file }}" ]; then
echo "::set-output name=have-changes::true"
# echo "::set-output name=have-changes::true"
echo "{ have-changes }={ true }" >> $GITHUB_OUTPUT
else
echo "::set-output name=have-changes::false"
# echo "::set-output name=have-changes::false"
echo "{ have-changes }={ false }" >> $GITHUB_OUTPUT
fi
echo "::set-output name=diff-file-result::$(cat "${{ inputs.result-file }}")"
# echo "::set-output name=diff-file-result::$(cat "${{ inputs.result-file }}")"
echo "{ diff-file-result }={ $(cat "${{ inputs.result-file }}") }" >> $GITHUB_OUTPUT
echo "::endgroup::"

0 comments on commit 3923a64

Please sign in to comment.