Skip to content

Commit 91809a6

Browse files
committed
#1: Fix tests
1 parent 4f7be37 commit 91809a6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/test_action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ jobs:
4646
run: |
4747
set -euo pipefail
4848
49-
PREFIX="https://github.com/${REPO}/wiki/"
5049
BADGE_DIR="wiki/${REPO}"
50+
PREFIX="https://github.com/${REPO}/${BADGE_DIR}/"
5151
5252
COMMENT=""
5353
5454
if [ -d "$BADGE_DIR" ]; then
5555
for f in "$BADGE_DIR"/*.svg; do
5656
[ -e "$f" ] || continue
5757
FILE=$(basename "$f")
58-
COMMENT+="![](${PREFIX}${FILE})\n"
58+
COMMENT+="[![](${PREFIX}${FILE})]() "
5959
done
6060
fi
6161

action.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ runs:
3030
shell: bash
3131
run: |
3232
set -euo pipefail
33-
readarray -t NAMES <<< "${{ inputs.names }}"
34-
readarray -t RESULTS <<< "${{ inputs.results }}"
33+
readarray -t NAMES < <(printf '%s\n' "${{ inputs.names }}" | sed '/^[[:space:]]*$/d')
34+
readarray -t RESULTS < <(printf '%s\n' "${{ inputs.results }}" | sed '/^[[:space:]]*$/d')
35+
3536
3637
[ "${#NAMES[@]}" -eq "${#RESULTS[@]}" ] || { echo "names and results lengths differ" >&2; exit 1; }
3738
@@ -44,12 +45,14 @@ runs:
4445
case "$RESULT" in
4546
success) COLOR=green ;;
4647
failure) COLOR=red ;;
47-
cancelled) COLOR=gray ;;
48-
*) COLOR=gray ;;
48+
cancelled) COLOR=blue ;;
49+
*) COLOR=blue ;;
4950
esac
5051
5152
ENCODED_NAME=$(echo "$NAME" | sed 's/-/--/g')
53+
echo "NAME: $NAME"
5254
BADGE_URL="https://img.shields.io/badge/${ENCODED_NAME}-${RESULT}-${COLOR}.svg"
55+
echo "BADGE_URL: $BADGE_URL"
5356
5457
curl -s -o "wiki/${GITHUB_REPOSITORY}/${NAME}-badge.svg" "$BADGE_URL"
5558
done

0 commit comments

Comments
 (0)