Skip to content

Commit cb5a64b

Browse files
Merge branch 'main' into sachinh-inject-code-editor-version
2 parents b7acd91 + d4c0b0f commit cb5a64b

File tree

2 files changed

+56
-6
lines changed

2 files changed

+56
-6
lines changed

.github/workflows/build-targets.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
build:
1111
name: Build Code Editor Targets
1212
runs-on: ubuntu-latest
13-
environment: build-targets-workflow-env
1413
strategy:
1514
matrix:
1615
build-target: [code-editor-server, code-editor-sagemaker-server, code-editor-web-embedded, code-editor-web-embedded-with-terminal]
@@ -73,4 +72,31 @@ jobs:
7372
with:
7473
name: ${{ github.sha }}-${{ matrix.build-target }}-build
7574
path: ${{ matrix.build-target }}-build.tar.gz
76-
retention-days: 90
75+
retention-days: 90
76+
handle-failures:
77+
name: Handle Failures
78+
runs-on: ubuntu-latest
79+
needs: build
80+
environment: build-targets-workflow-env
81+
if: failure()
82+
permissions:
83+
id-token: write # Required for OIDC
84+
env:
85+
REPOSITORY: ${{ github.repository }}
86+
AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
87+
steps:
88+
- name: Use role credentials for metrics
89+
id: aws-creds
90+
continue-on-error: ${{ env.REPOSITORY != 'aws/code-editor' }}
91+
uses: aws-actions/configure-aws-credentials@v4
92+
with:
93+
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
94+
aws-region: us-east-1
95+
- name: Report failure
96+
if: steps.aws-creds.outcome == 'success'
97+
run: |
98+
aws cloudwatch put-metric-data \
99+
--namespace "GitHub/Workflows" \
100+
--metric-name "ExecutionsFailed" \
101+
--dimensions "Repository=${{ env.REPOSITORY }},Workflow=BuildTargets" \
102+
--value 1

.github/workflows/release.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ jobs:
1515
runs-on: ubuntu-latest
1616
permissions:
1717
contents: write # Required for creating releases
18-
environment: release-workflow-env
1918
env:
20-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2119
COMMIT_SHA: ${{ github.sha }}
22-
REPOSITORY: ${{ github.repository }}
2320
VERSION_NUM: ${{ github.event.inputs.version || github.ref_name }}
2421
SAGEMAKER_ARTIFACT_PREFIX: "code-editor-sagemaker-server"
2522
steps:
@@ -108,4 +105,31 @@ jobs:
108105
gh release create "$VERSION_NUM" *.tar.gz \
109106
--title "Release $VERSION_NUM" \
110107
--notes "Release $VERSION_NUM"
111-
fi
108+
fi
109+
handle-failures:
110+
name: Handle Failures
111+
runs-on: ubuntu-latest
112+
needs: release
113+
environment: release-workflow-env
114+
if: failure()
115+
permissions:
116+
id-token: write # Required for OIDC
117+
env:
118+
REPOSITORY: ${{ github.repository }}
119+
AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
120+
steps:
121+
- name: Use role credentials for metrics
122+
id: aws-creds
123+
continue-on-error: ${{ env.REPOSITORY != 'aws/code-editor' }}
124+
uses: aws-actions/configure-aws-credentials@v4
125+
with:
126+
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
127+
aws-region: us-east-1
128+
- name: Report failure
129+
if: steps.aws-creds.outcome == 'success'
130+
run: |
131+
aws cloudwatch put-metric-data \
132+
--namespace "GitHub/Workflows" \
133+
--metric-name "ExecutionsFailed" \
134+
--dimensions "Repository=${{ env.REPOSITORY }},Workflow=Release" \
135+
--value 1

0 commit comments

Comments
 (0)