From 7251886a4c52c88f2d917ec4c680e8b0f11612d5 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Dec 2023 20:37:56 -0800 Subject: [PATCH] Validate PR number --- action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/action.yml b/action.yml index 99acb13..cca34c8 100644 --- a/action.yml +++ b/action.yml @@ -53,6 +53,13 @@ runs: echo "Event type: unknown or unexpected" fi + # Validate PR number + if [ ! "${PR_NO}" =~ ^[0-9]+$ ]; then + echo "PR number format incorrect: ${pr}" + exit 1 + fi + + # Output PR number echo "Summary ---" echo -e "\tPR: ${pr}" echo "pr=${pr}" >> $GITHUB_OUTPUT