From db15f22df70e696041f25998cdbfac4dd3303801 Mon Sep 17 00:00:00 2001 From: jparisu Date: Thu, 11 May 2023 10:53:57 +0200 Subject: [PATCH] Fix git_diff action Signed-off-by: jparisu --- ubuntu/check_version_update/action.yml | 72 +------------------------- ubuntu/git_diff/action.yml | 6 +-- 2 files changed, 5 insertions(+), 73 deletions(-) diff --git a/ubuntu/check_version_update/action.yml b/ubuntu/check_version_update/action.yml index 2b0ee447..e6ee3ccb 100644 --- a/ubuntu/check_version_update/action.yml +++ b/ubuntu/check_version_update/action.yml @@ -32,85 +32,17 @@ runs: with: workspace: ${{ github.workspace }} - - name: Test outputs - shell: bash - id: test1 - run: | - - echo "::group::Test" - - echo "$GITHUB_OUTPUT" - cat $GITHUB_OUTPUT - echo "test1-output=false" >> $GITHUB_OUTPUT - cat $GITHUB_OUTPUT - - echo "::endgroup::" - - - - name: Test outputs reception - shell: bash - run: | - - echo "$GITHUB_OUTPUT" - cat $GITHUB_OUTPUT - echo "${{ steps.test1.outputs.test1-output }}" - - name: Get diff file of version file - id: diff2 + id: git-diff uses: eProsima/eProsima-CI/ubuntu/git_diff@feature/versions-update with: file-path: ${{ github.workspace }}/${{ inputs.version-file-path }} - - name: get_git_diff_files - id: diff1 - shell: bash - run: | - - echo "::group::Get git modifications of file ${{ inputs.file-path }}" - - echo "have-changes=false" >> $GITHUB_OUTPUT - - echo "diff-file-result=" >> $GITHUB_OUTPUT - - echo "::endgroup::" - - name: Check if file change shell: bash run: | - if [[ "${{ steps.git_diff.outputs.have-changes }}" != "true" ]]; then - echo "Version file ${{ inputs.version-file-path }} has not been updated" - echo "T.T" - else - echo "Version file ${{ inputs.version-file-path }} updated." - echo "HURRAY! ^.^" - fi - - if [[ "${{ steps.diff3.outputs.have-changes }}" != "true" ]]; then - echo "Version file ${{ inputs.version-file-path }} has not been updated" - echo "T.T" - else - echo "Version file ${{ inputs.version-file-path }} updated." - echo "HURRAY! ^.^" - fi - - if [[ "${{ steps.diff2.outputs.have-changes }}" != "true" ]]; then - echo "Version file ${{ inputs.version-file-path }} has not been updated" - echo "T.T" - else - echo "Version file ${{ inputs.version-file-path }} updated." - echo "HURRAY! ^.^" - fi - - if [[ "${{ steps.diff2.outputs.have-change }}" != "true" ]]; then - echo "Version file ${{ inputs.version-file-path }} has not been updated" - echo "T.T" - else - echo "Version file ${{ inputs.version-file-path }} updated." - echo "HURRAY! ^.^" - fi - - if [[ "${{ steps.diff1.outputs.have-changes }}" != "true" ]]; then + if [[ "${{ steps.git-diff.outputs.have-changes }}" != "true" ]]; then echo "Version file ${{ inputs.version-file-path }} has not been updated" echo "T.T" exit 1 diff --git a/ubuntu/git_diff/action.yml b/ubuntu/git_diff/action.yml index c66b559a..d66be805 100644 --- a/ubuntu/git_diff/action.yml +++ b/ubuntu/git_diff/action.yml @@ -31,16 +31,18 @@ outputs: diff-file-result: description: The path to the file containing the diff, if changes were detected + value: ${{ steps.run.outputs.diff-file-result }} have-changes: description: Whether there have been changes in such file + value: ${{ steps.run.outputs.have-changes }} runs: using: composite steps: - name: get_git_diff_files - id: diff3 + id: run shell: bash run: | @@ -54,13 +56,11 @@ runs: if [ -s "${{ inputs.result-file }}" ]; then echo "have-changes=true" >> $GITHUB_OUTPUT - echo "have-change=true" >> $GITHUB_OUTPUT echo "File has changes" else echo "have-changes=false" >> $GITHUB_OUTPUT - echo "have-change=false" >> $GITHUB_OUTPUT echo "File has not changes" fi