@@ -5,6 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55FILTER=" $SCRIPT_DIR /filter-unlinked-cve-issues.jq"
66DISCOVERY_SCRIPT=" $SCRIPT_DIR /find-unlinked-cve-issues.sh"
77WORKFLOW_FILE=" $SCRIPT_DIR /../workflows/_cve-remediation.yml"
8+ CALLER_WORKFLOW_FILE=" $SCRIPT_DIR /../workflows/cve-remediation.yml"
89
910assert_json () {
1011 local description=" $1 "
@@ -22,8 +23,9 @@ assert_json() {
2223assert_workflow_contains () {
2324 local description=" $1 "
2425 local expected=" $2 "
26+ local workflow_file=" ${3:- $WORKFLOW_FILE } "
2527
26- if ! grep -Fq -- " $expected " " $WORKFLOW_FILE " ; then
28+ if ! grep -Fq -- " $expected " " $workflow_file " ; then
2729 echo " FAIL: $description "
2830 echo " Expected workflow to contain: $expected "
2931 exit 1
@@ -33,8 +35,9 @@ assert_workflow_contains() {
3335assert_workflow_not_contains () {
3436 local description=" $1 "
3537 local unexpected=" $2 "
38+ local workflow_file=" ${3:- $WORKFLOW_FILE } "
3639
37- if grep -Fq -- " $unexpected " " $WORKFLOW_FILE " ; then
40+ if grep -Fq -- " $unexpected " " $workflow_file " ; then
3841 echo " FAIL: $description "
3942 echo " Expected workflow not to contain: $unexpected "
4043 exit 1
@@ -276,5 +279,13 @@ assert_workflow_not_contains \
276279assert_workflow_not_contains \
277280 " does not use unavailable job workflow SHA context" \
278281 ' job.workflow_sha'
282+ assert_workflow_contains \
283+ " passes a numeric manual or scheduled issue limit through an allowed context" \
284+ " fromJSON(github.event.inputs.max_issues || '50')" \
285+ " $CALLER_WORKFLOW_FILE "
286+ assert_workflow_not_contains \
287+ " does not use the unavailable inputs context in a reusable workflow call" \
288+ ' ${{ inputs.max_issues' \
289+ " $CALLER_WORKFLOW_FILE "
279290
280291echo " All CVE remediation tests passed."
0 commit comments