You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix YAML syntax error and security issue in stale-hip-management workflow
- Fix YAML syntax error on line 94 by using heredoc for multi-line comment
- Add input validation to prevent code injection attacks
- Move workflow inputs to environment variables with validation
- Replace backtick quotes with single quotes for better YAML compatibility
Signed-off-by: Michael Garber <michael.garber@hashgraph.com>
if ! [[ "$INACTIVITY_DAYS_INPUT" =~ ^[0-9]+$ ]]; then
47
+
echo "Error: inactivity_days must be a positive integer"
48
+
exit 1
49
+
fi
50
+
if ! [[ "$WARNING_DAYS_INPUT" =~ ^[0-9]+$ ]]; then
51
+
echo "Error: warning_days must be a positive integer"
52
+
exit 1
53
+
fi
54
+
55
+
INACTIVITY_DAYS="$INACTIVITY_DAYS_INPUT"
56
+
WARNING_DAYS="$WARNING_DAYS_INPUT"
46
57
CURRENT_TIME=$(date +%s)
47
58
48
59
echo "Configuration:"
@@ -89,9 +100,12 @@ jobs:
89
100
echo " Posting warning for PR #$PR_NUMBER (inactive for $DAYS_INACTIVE days)"
90
101
91
102
# Post warning comment (no label yet)
92
-
gh pr comment $PR_NUMBER --body "This HIP appears to have been inactive for $DAYS_INACTIVE days. If there is no activity or response within $WARNING_DAYS days, it will be marked as Stagnant and closed.
103
+
gh pr comment $PR_NUMBER --body "$(cat <<EOF
104
+
This HIP appears to have been inactive for $DAYS_INACTIVE days. If there is no activity or response within $WARNING_DAYS days, it will be marked as Stagnant and closed.
93
105
94
-
To prevent automatic closure, simply add a comment with an update, make a commit, or react to this message. Maintainers can also add a \`keep-open\` label to exempt this HIP."
106
+
To prevent automatic closure, simply add a comment with an update, make a commit, or react to this message. Maintainers can also add a 'keep-open' label to exempt this HIP.
0 commit comments