This commit is contained in:
Laurent Destailleur 2023-06-30 12:11:30 +02:00
parent e83a53fe9a
commit ba8801f385
2 changed files with 10 additions and 4 deletions

View file

@ -30,7 +30,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 50 # fetch all history of all branches
ref: ${{ env.BRANCH }}
fetch-depth: 20 # fetch last 10 commits only
- name: Get files changed on push
# if push on develop or master or main then get diff between current and previous commit
@ -60,16 +61,21 @@ jobs:
all_changed_files=${{ steps.files_changed_on_pr.outputs.all_changed_files }}
fi
echo all files changed are -
echo All files changed are:
echo $all_changed_files
echo Save vars into GITHUB_OUTPUT
echo "all_changed_files=$all_changed_files" >> $GITHUB_OUTPUT
echo "boolean_output=false" >> $GITHUB_OUTPUT
echo "::set-output name=all_changed_files::$all_changed_files"
echo "::set-output name=boolean_output::false"
for file in $all_changed_files; do
echo file = $file
if [[ $file == ${{inputs.folder_path}} ]]; then
echo file matches folder_path pattern
echo At least one file was found matching folder_path pattern
echo "::set-output name=boolean_output::true"
echo "boolean_output=false" >> $GITHUB_OUTPUT
break
fi
done

View file

@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 10
- name: echo all changed files
- name: echo Get list of all changed files
run: |
echo ${{ needs.filesChanged.outputs.all_changed_files }}
echo boolean_output=${{ needs.filesChanged.outputs.boolean_output }}