File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 99 - zhaez/nightly-build
1010
1111env :
12+ AWS_DEFAULT_REGION : us-east-1
1213 BRANCH_NAME : nightly-dependency-updates
1314
1415jobs :
@@ -117,4 +118,28 @@ jobs:
117118 id-token : write
118119 contents : read
119120 with :
120- ref : nightly-dependency-updates
121+ ref : nightly-dependency-updates
122+
123+ publish-nightly-build-status :
124+ name : " Publish Nightly Build Status"
125+ needs : [ update-and-create-pr, build-and-test ]
126+ runs-on : ubuntu-latest
127+ if : always()
128+ steps :
129+ - name : Configure AWS Credentials for emitting metrics
130+ uses : aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # 5.0.0
131+ with :
132+ role-to-assume : ${{ secrets.MONITORING_ROLE_ARN }}
133+ aws-region : ${{ env.AWS_DEFAULT_REGION }}
134+
135+ - name : Publish nightly build status
136+ run : |
137+ if [[ "${{ needs.build-and-test.result }}" == "skipped" ]]; then
138+ echo "Build was skipped (no changes), not publishing metric"
139+ else
140+ value="${{ needs.build-and-test.result == 'success' && '0.0' || '1.0'}}"
141+ aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
142+ --metric-name Failure \
143+ --dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=nightly_build \
144+ --value $value
145+ fi
You can’t perform that action at this time.
0 commit comments