Skip to content

Commit

Permalink
Merge pull request #5783 from rvykydal/fix-kstest-pr-option-of-kickst…
Browse files Browse the repository at this point in the history
…art-test-workflow

infra: fix --kstest-pr option of /kickstart-test workflow
  • Loading branch information
rvykydal authored Jul 23, 2024
2 parents 3655898 + bf7a178 commit 1ea55e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/kickstart-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,15 @@ jobs:
run: |
# extract first line and cut out the "/kickstart-tests" first word
ARGS=$(echo "$BODY" | sed -n '1 s/^[^ ]* *//p' | sed 's/[[:space:]]*$//')
# parse --kstest-pr option
OPTS="$(getopt -q -o "" --long kstest-pr: -- $ARGS)" || true
PR=${OPTS#" --kstest-pr '"}
PR=$(echo $PR | cut -d " " -f1)
PR=${PR%"'"}
PR=${PR%"--"}
echo "workflow arguments are: $ARGS"
# remove --kstest-pr option
ARGS=$(echo "$ARGS" | sed -r -e "s#--kstest-pr( +|=)$PR ##" | sed 's/[[:space:]]*$//')
echo "test selection arguments are: $ARGS"
echo "comment_args=${ARGS}" >> $GITHUB_OUTPUT
echo "kickstart-tests PR: $PR"
echo "kstest_pr=${PR}" >> $GITHUB_OUTPUT
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/kickstart-tests.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ jobs:
run: |
# extract first line and cut out the "/kickstart-tests" first word
ARGS=$(echo "$BODY" | sed -n '1 s/^[^ ]* *//p' | sed 's/[[:space:]]*$//')
# parse --kstest-pr option
OPTS="$(getopt -q -o "" --long kstest-pr: -- $ARGS)" || true
PR=${OPTS#" --kstest-pr '"}
PR=$(echo $PR | cut -d " " -f1)
PR=${PR%"'"}
PR=${PR%"--"}
echo "workflow arguments are: $ARGS"
# remove --kstest-pr option
ARGS=$(echo "$ARGS" | sed -r -e "s#--kstest-pr( +|=)$PR ##" | sed 's/[[:space:]]*$//')
echo "test selection arguments are: $ARGS"
echo "comment_args=${ARGS}" >> $GITHUB_OUTPUT
echo "kickstart-tests PR: $PR"
echo "kstest_pr=${PR}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 1ea55e9

Please sign in to comment.