Skip to content

Add runtime guards and tools check#19

Open
ndivho-makhuvha wants to merge 1 commit into
masterfrom
feat/add-runtime-guards
Open

Add runtime guards and tools check#19
ndivho-makhuvha wants to merge 1 commit into
masterfrom
feat/add-runtime-guards

Conversation

@ndivho-makhuvha

@ndivho-makhuvha ndivho-makhuvha commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Overview

Adds a tool installed validation before action is run, also adds warning days guards, warning days should be a positive integer.

Release Notes

  • Tool installed on runner before action check.
  • Warning days a positive interger guard before run.

Related

Closes #5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens the action’s runtime bash script by adding defensive checks (tool availability, stricter warning_days validation, and safe operation when GITHUB_STEP_SUMMARY is unset), and documents the new behavior in the README.

Changes:

  • Fail fast if required tools (openssl, jq) are missing on the runner.
  • Enforce warning_days as a positive integer (reject 0 and non-numeric values).
  • Skip GitHub Step Summary writes when GITHUB_STEP_SUMMARY is unset (local/act safe).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
validate.sh Adds startup tool checks, strengthens warning_days validation, and guards Step Summary writes behind a GITHUB_STEP_SUMMARY presence check.
README.md Documents the tool check and the behavior when running outside GitHub Actions without GITHUB_STEP_SUMMARY.

Comment thread validate.sh
Comment on lines +41 to 43
if ! [[ "$INPUT_WARNING_DAYS" =~ ^[0-9]+$ ]] || [[ "$((10#$INPUT_WARNING_DAYS))" -eq 0 ]]; then
echo "::error::warning_days must be a positive integer, got: '$INPUT_WARNING_DAYS'"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add runtime guards: input validation, tool availability check, and GITHUB_STEP_SUMMARY guard

2 participants