Skip to content

Commit

Permalink
Setting the output variable outside of the loop so that it always has…
Browse files Browse the repository at this point in the history
… a value.
  • Loading branch information
DaveW-STFC committed Sep 19, 2024
1 parent 0228901 commit 5b8eb18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pr_copied_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,18 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "One or more files in the folder has changed."
echo "Files that have changed: $ALL_CHANGED_FILES"
echo "Files that have changed: $ALL_CHANGED_FILES"
echo "result=true" >> "$GITHUB_OUTPUT"
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $(${PWD}/scripts/pr_check_copy.sh $file) == 'false' ]]; then
echo "result=false" >> "$GITHUB_OUTPUT"
break;
else
echo "result=true" >> "$GITHUB_OUTPUT"
fi
done
comment_pr:
needs: changed_files
if: ${{needs.changed_files.outputs.any_changed}} == 'true'
if: contains(needs.changed_files.outputs.any_changed, 'true')
runs-on: ubuntu-latest
steps:
- env:
Expand Down

0 comments on commit 5b8eb18

Please sign in to comment.