File tree Expand file tree Collapse file tree
actions/db-inserts-verify Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ inputs:
1414 default : ' false'
1515 parse_regex :
1616 description : RegEx to capture ROWS_INSERTED=NNN (advanced override)
17- required : false
17+ required : ' '
1818 default : ' ROWS_INSERTED\s*=\s*([0-9]+)'
1919
2020runs :
2727 set -euo pipefail
2828 echo "[verify] running: ${{ inputs.run }}"
2929 bash -lc '${{ inputs.run }}' 2>&1 | tee report.out
30- count="$(grep -Eo "${{ inputs.parse_regex }}" report.out | sed -E 's/.*=([0-9]+).*/\1/' | tail -n1 || true)"
30+
31+
32+ # Pick regex
33+ regex="${{ inputs.parse_regex }}"
34+ if [[ -z "$regex" ]]; then
35+ # Default: match common formats
36+ regex='([0-9]+)[[:space:]]*(rows inserted|total inserted|committed|Inserted|ROWS_INSERTED=)'
37+ fi
38+
39+ # Find last match
40+ count="$(grep -Eo "${{ inputs.parse_regex }}" report.out | sed -E 's/.*=([0-9]+).*/\1/' | tail -n1 || true)"
3141 if [[ -z "${count:-}" ]]; then count=0; fi
3242 echo "rows_inserted=${count}" >> "$GITHUB_OUTPUT"
3343
Original file line number Diff line number Diff line change 1414
1515jobs :
1616 deploy :
17- name : Testops Check All Jobs on Push
17+ name : Demo - Verify DB insert / delete
1818 runs-on : ubuntu-latest
1919
2020 steps :
You can’t perform that action at this time.
0 commit comments