Skip to content

Commit d4e983c

Browse files
authored
Send main build metrics (#234)
1 parent 4556edc commit d4e983c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/main_build.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,24 @@ jobs:
155155
secrets: inherit
156156
permissions:
157157
id-token: write
158-
contents: read
158+
contents: read
159+
160+
publish-main-build-status:
161+
name: "Publish Main Build Status"
162+
needs: [ build, application-signals-e2e-test ]
163+
runs-on: ubuntu-latest
164+
if: always()
165+
steps:
166+
- name: Configure AWS Credentials for emitting metrics
167+
uses: aws-actions/configure-aws-credentials@v4
168+
with:
169+
role-to-assume: ${{ secrets.MONITORING_ROLE_ARN }}
170+
aws-region: us-east-1
171+
172+
- name: Publish main build status
173+
run: |
174+
value="${{ needs.build.result == 'success' && needs.application-signals-e2e-test.result == 'success' && '0.0' || '1.0'}}"
175+
aws cloudwatch put-metric-data --namespace 'ADOT/GitHubActions' \
176+
--metric-name Failure \
177+
--dimensions repository=${{ github.repository }},branch=${{ github.ref_name }},workflow=main_build \
178+
--value $value

0 commit comments

Comments
 (0)