Skip to content

Commit c455bce

Browse files
06180618reesscot
authored
feat: add alert for publishing @next version (#2297)
* feat: add alert for publishing @next version * fix: remove trigger-success-alarm * Update .github/workflows/test-deploy-main.yml Co-authored-by: Scott Rees <[email protected]> * fix: address review comments Co-authored-by: 0618 <[email protected]> Co-authored-by: Scott Rees <[email protected]>
1 parent 5565152 commit c455bce

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/run-and-test-builds.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ jobs:
9696
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
9797
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
9898

99-
trigger-failure-alarm:
100-
# Triggers an alarm if any of builds failed.
99+
log-failure-metric:
100+
# Send data point 1 to metric RunTimeTestsFailure, if failure
101101
runs-on: ubuntu-latest
102102
environment: ci
103103
needs: build
@@ -111,8 +111,8 @@ jobs:
111111
aws-region: us-east-1
112112
- run: aws cloudwatch put-metric-data --metric-name RunTimeTestsFailure --namespace GithubCanaryApps --value 1
113113

114-
trigger-sucess-alarm:
115-
# Triggers an alarm if all the builds succeed
114+
log-success-metric:
115+
# Send data point 0 to metric RunTimeTestsFailure, if success
116116
runs-on: ubuntu-latest
117117
environment: ci
118118
needs: build

.github/workflows/test-deploy-main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,33 @@ jobs:
167167
- name: Run yarn build on each sample app
168168
run: yarn build
169169
working-directory: ./canary
170+
171+
log-failure-metric:
172+
# Send data point 1 to metric RunTimeTestsFailure, if success
173+
runs-on: ubuntu-latest
174+
environment: ci
175+
needs: build
176+
if: ${{ failure() }}
177+
steps:
178+
- name: Configure AWS credentials
179+
uses: aws-actions/configure-aws-credentials@v1
180+
with:
181+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
182+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
183+
aws-region: us-east-1
184+
- run: aws cloudwatch put-metric-data --metric-name publishFailure --namespace GithubCanaryApps --value 1
185+
186+
log-success-metric:
187+
# Send data point 0 to metric RunTimeTestsFailure, if success
188+
runs-on: ubuntu-latest
189+
environment: ci
190+
needs: build
191+
if: ${{ success() }}
192+
steps:
193+
- name: Configure AWS credentials
194+
uses: aws-actions/configure-aws-credentials@v1
195+
with:
196+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
197+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
198+
aws-region: us-east-1
199+
- run: aws cloudwatch put-metric-data --metric-name publishFailure --namespace GithubCanaryApps --value 0

0 commit comments

Comments
 (0)