Skip to content

Commit

Permalink
fix workflow
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <[email protected]>
  • Loading branch information
jparisu committed May 10, 2023
1 parent 22a1e54 commit d0d40a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: pr_test
description: Check Pull Request

on:
workflow_dispatch:
Expand All @@ -11,4 +10,4 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check wether the versions.md file have been updated
uses: eProsima/eProsima-CI/ubuntu/check_version_update@main
uses: eProsima/eProsima-CI/ubuntu/check_version_update@feature/versions-update
7 changes: 4 additions & 3 deletions ubuntu/check_version_update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@ runs:
steps:

- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@main
uses: eProsima/eProsima-CI/external/checkout@feature/versions-update
with:
path: ${{ github.workspace }}

- name: Fetch all branches and tags
uses: eProsima/eProsima-CI/ubuntu/git_fetch_all@main
uses: eProsima/eProsima-CI/ubuntu/git_fetch_all@feature/versions-update
with:
workspace: ${{ github.workspace }}

- name: Get diff file of version file
id: git-diff
uses: eProsima/eProsima-CI/ubuntu/git_diff@main
uses: eProsima/eProsima-CI/ubuntu/git_diff@feature/versions-update
with:
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
9 changes: 5 additions & 4 deletions ubuntu/git_diff/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ runs:
shell: bash
run: |
echo "::group::Get git modifications of file ${{ inputs.file-path }}""
echo "::group::Get git modifications of file ${{ inputs.file-path }}"
if git diff --name-only "${{ inputs.base-ref }}" "${{ inputs.head-ref }}" ${{ inputs.diff-args }} | grep -q "${{ inputs.file-path }}"; then
git diff "${{ inputs.base-ref }}" "${{ inputs.head-ref }}" ${{ inputs.diff-args }} "${{ inputs.file-path }}" > "${{ inputs.result-file }}"
git diff "${{ inputs.base-ref }}" "${{ inputs.head-ref }}" ${{ inputs.diff-args }} "${{ inputs.file-path }}" > "${{ inputs.result-file }}"
if [ -s "${{ inputs.result-file }}" ]; then
echo "::set-output name=diff-file-result::$(cat ${{ inputs.result-file }})"
echo "::set-output name=have-changes::true"
else
Expand All @@ -58,4 +57,6 @@ runs:
fi
echo "::set-output name=diff-file-result::$(cat "${{ inputs.result-file }}")"
echo "::endgroup::"

0 comments on commit d0d40a2

Please sign in to comment.