File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
.github/actions/workflow-metrics Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 3030 job_name="${job_name}(${{ matrix.os }})"
3131 fi
3232
33+ # Determine success/failure (1 for success, 0 for failure)
34+ if [ "${{ job.status }}" == "success" ]; then
35+ success_value=1
36+ else
37+ success_value=0
38+ fi
39+
3340 aws cloudwatch put-metric-data \
3441 --namespace "GitHub/Workflows" \
3542 --metric-data '[{
5057 "Value": "${{ github.repository }}"
5158 }
5259 ]
53- }]'
60+ },
61+ {
62+ "MetricName": "Success",
63+ "Value": '$success_value',
64+ "Unit": "Count",
65+ "Dimensions": [
66+ {
67+ "Name": "WorkflowName",
68+ "Value": "'${{ github.workflow }}'"
69+ },
70+ {
71+ "Name": "JobName",
72+ "Value": "'$job_name'"
73+ },
74+ {
75+ "Name": "Repository",
76+ "Value": "'${{ github.repository }}'"
77+ }
78+ ]
79+ }
80+ ]'
You can’t perform that action at this time.
0 commit comments