Add configurable polling interval for GitHub API calls (#197)

- Add polling-interval-seconds input parameter to action.yaml (default: 10)
- Update polling logic to use configurable interval
- Add input validation to ensure positive values
- Update README with usage documentation

This allows users to customize how frequently the action polls GitHub API
for approval status, enabling them to reduce API calls or speed up response
times based on their needs.
This commit is contained in:
Brian Sneddon 2025-11-16 07:10:04 -09:00 committed by GitHub
parent 32d182eec2
commit 1afc677e1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 3 deletions

View file

@ -7,7 +7,7 @@ import (
)
const (
pollingInterval time.Duration = 10 * time.Second
defaultPollingInterval time.Duration = 10 * time.Second
envVarRepoFullName string = "GITHUB_REPOSITORY"
envVarRunID string = "GITHUB_RUN_ID"
@ -25,6 +25,7 @@ const (
envVarFailOnDenial string = "INPUT_FAIL-ON-DENIAL"
envVarTargetRepoOwner string = "INPUT_TARGET-REPOSITORY-OWNER"
envVarTargetRepo string = "INPUT_TARGET-REPOSITORY"
envVarPollingIntervalSeconds string = "INPUT_POLLING-INTERVAL-SECONDS"
)
var (