Skip to content

Commit 646ab5a

Browse files
authored
chore: add metrics to update-release-branch workflow (#1543)
1 parent d03dc2c commit 646ab5a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/update-release-branch.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ jobs:
2727
update-release:
2828
runs-on: ubuntu-latest
2929
steps:
30+
- name: Set start timestamp
31+
id: start
32+
run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT"
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
37+
aws-region: us-west-2
38+
- name: Setup kat
39+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main
3040
- uses: actions/checkout@v4
3141
with:
3242
ref: 'main'
@@ -107,3 +117,23 @@ jobs:
107117
echo "pushing changes to release branch";
108118
git push origin release;
109119
fi
120+
- name: Calculate duration
121+
id: end
122+
run: |
123+
printf -v now '%(%s)T'
124+
duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
125+
printf 'duration=$duration\n' >> "$GITHUB_OUTPUT"
126+
- name: Emit metrics
127+
if: always() # run this step even if previous steps failed or the job is canceled
128+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/emit-metrics
129+
with:
130+
namespace: CI Metrics
131+
dimensions: |
132+
Product=aws-sdk-kotlin
133+
Trigger=${{ github.event_name == 'schedule' && 'schedule' || 'manual' }}
134+
metrics: |
135+
ReleaseMergeAttempted:1:Count
136+
ReleaseMergeSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
137+
ReleaseMergeCanceled:${{ job.status == 'cancelled' && '1' || '0' }}:Count
138+
ReleaseMergeFailed:${{ job.status == 'failure' && '1' || '0' }}:Count
139+
ReleaseMergeDuration:${{ steps.end.outputs.duration }}:Seconds

0 commit comments

Comments
 (0)