fix: extract response time metrics from markdown tables
- Use direct grep for 'Time to first response' and 'Time to close' table rows - Parse table columns with awk -F'|' to get actual time values - Should now show response times instead of N/A
This commit is contained in:
6
.github/workflows/weekly-metrics-discord.yml
vendored
6
.github/workflows/weekly-metrics-discord.yml
vendored
@@ -49,8 +49,8 @@ jobs:
|
|||||||
# Parse the metrics from the generated markdown files
|
# Parse the metrics from the generated markdown files
|
||||||
if [ -f "issue_metrics.md" ]; then
|
if [ -f "issue_metrics.md" ]; then
|
||||||
# Extract key metrics using grep/awk
|
# Extract key metrics using grep/awk
|
||||||
AVG_TIME_TO_FIRST_RESPONSE=$(grep -A 1 "Average time to first response" issue_metrics.md | tail -1 | awk '{print $3}' || echo "N/A")
|
AVG_TIME_TO_FIRST_RESPONSE=$(grep "Time to first response" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "N/A")
|
||||||
AVG_TIME_TO_CLOSE=$(grep -A 1 "Average time to close" issue_metrics.md | tail -1 | awk '{print $3}' || echo "N/A")
|
AVG_TIME_TO_CLOSE=$(grep "Time to close" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "N/A")
|
||||||
NUM_ISSUES_CREATED=$(grep "Total number of items created" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
NUM_ISSUES_CREATED=$(grep "Total number of items created" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
||||||
NUM_ISSUES_CLOSED=$(grep "Number of items closed" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
NUM_ISSUES_CLOSED=$(grep "Number of items closed" issue_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
||||||
else
|
else
|
||||||
@@ -61,7 +61,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "pr_metrics.md" ]; then
|
if [ -f "pr_metrics.md" ]; then
|
||||||
PR_AVG_TIME_TO_MERGE=$(grep -A 1 "Average time to close" pr_metrics.md | tail -1 | awk '{print $3}' || echo "N/A")
|
PR_AVG_TIME_TO_MERGE=$(grep "Time to close" pr_metrics.md | awk -F'|' '{print $3}' | xargs || echo "N/A")
|
||||||
NUM_PRS_CREATED=$(grep "Total number of items created" pr_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
NUM_PRS_CREATED=$(grep "Total number of items created" pr_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
||||||
NUM_PRS_MERGED=$(grep "Number of items closed" pr_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
NUM_PRS_MERGED=$(grep "Number of items closed" pr_metrics.md | awk -F'|' '{print $3}' | xargs || echo "0")
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user