Skip to content

Commit

Permalink
ci: pr-check deal with scenario when no libs have changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-FFFFFF committed Jul 4, 2024
1 parent d46e3cc commit c144637
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ jobs:
id: libs
run: |
DIFF="$(git diff --name-only origin/${{ github.base_ref }} | xargs dirname | sort | uniq)"
LIBS=$(echo "${DIFF}" | grep '^platform/' | cut -d'/' -f2 | sort | uniq)
LIBDIFF="$(echo "${DIFF}" | grep '^platform/')"
if [ -z "${LIBDIFF}" ]; then
echo "list=[]" >> "$GITHUB_OUTPUT"
exit 0
fi
LIBS=$(echo "${LIBDIFF}" | cut -d'/' -f2 | sort | uniq)
JSONARRAY=$(echo "${LIBS}" | jq -R -s -c 'split("\n")'[:-1])
echo "list=${JSONARRAY}" >> "$GITHUB_OUTPUT"
shell: bash
Expand Down

0 comments on commit c144637

Please sign in to comment.