Skip to content

Commit

Permalink
Merge branch 'main' into SankyRed/list-stack-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayak-kukreja authored Mar 12, 2024
2 parents 03f27d8 + bd41b9f commit 406e66c
Show file tree
Hide file tree
Showing 15 changed files with 1,147 additions and 0 deletions.
File renamed without changes.
58 changes: 58 additions & 0 deletions .github/workflows/repo-metrics-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Weekly repo metrics
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * MON'

permissions:
issues: write
pull-requests: read

jobs:
build:
# this workflow will always fail in forks; bail if this isn't running in the upstream
if: github.repository == 'aws/aws-cdk'
name: metrics
runs-on: ubuntu-latest

steps:
- name: Get dates for last week
shell: bash
run: |
# Calculate the date of the previous Monday
PREVIOUS_MONDAY=$(date -d "7 days ago" "+%Y-%m-%d")
# Calculate the date of the current Sunday
CURRENT_SUNDAY=$(date -d "1 day ago" "+%Y-%m-%d")
# Set an environment variable with the date range
echo "$PREVIOUS_MONDAY..$CURRENT_SUNDAY"
echo "last_week=$PREVIOUS_MONDAY..$CURRENT_SUNDAY" >> "$GITHUB_ENV"
- name: Report on issues
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:aws/aws-cdk is:issue created:${{ env.last_week }} -reason:"not planned"'

- name: Create report for issues
uses: peter-evans/create-issue-from-file@v5
with:
title: Weekly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: paulhcsun

- name: Report on PRs
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:aws/aws-cdk is:pr created:${{ env.last_week }} -is:draft'

- name: Create report for PRs
uses: peter-evans/create-issue-from-file@v5
with:
title: Weekly PR metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: paulhcsun

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"Resources": {
"Bucket83908E77": {
"Type": "AWS::S3::Bucket",
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"GluecrawlwerRole4E24839F": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "glue.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSGlueServiceRole"
]
]
}
]
}
},
"Database": {
"Type": "AWS::Glue::Database",
"Properties": {
"CatalogId": {
"Ref": "AWS::AccountId"
},
"DatabaseInput": {
"Description": "My database",
"Name": "my-database"
}
}
},
"Crawler": {
"Type": "AWS::Glue::Crawler",
"Properties": {
"DatabaseName": {
"Ref": "Database"
},
"Role": {
"Fn::GetAtt": [
"GluecrawlwerRole4E24839F",
"Arn"
]
},
"Targets": {
"S3Targets": [
{
"Path": {
"Fn::Join": [
"",
[
"s3://",
{
"Ref": "Bucket83908E77"
},
"/"
]
]
}
}
]
}
}
},
"StateMachineRole543B9670": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "states.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"StateMachineRoleDefaultPolicyDA5F7DA8": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": [
"glue:GetCrawler",
"glue:StartCrawler"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":glue:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":crawler/",
{
"Ref": "Crawler"
}
]
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "StateMachineRoleDefaultPolicyDA5F7DA8",
"Roles": [
{
"Ref": "StateMachineRole543B9670"
}
]
}
},
"StateMachine81935E76": {
"Type": "AWS::StepFunctions::StateMachine",
"Properties": {
"DefinitionString": {
"Fn::Join": [
"",
[
"{\"StartAt\":\"Start Task\",\"States\":{\"Start Task\":{\"Type\":\"Pass\",\"Next\":\"Glue Crawler Task\"},\"Glue Crawler Task\":{\"Next\":\"End Task\",\"Type\":\"Task\",\"Resource\":\"arn:",
{
"Ref": "AWS::Partition"
},
":states:::aws-sdk:glue:startCrawler\",\"Parameters\":{\"Name\":\"",
{
"Ref": "Crawler"
},
"\"}},\"End Task\":{\"Type\":\"Pass\",\"End\":true}}}"
]
]
},
"RoleArn": {
"Fn::GetAtt": [
"StateMachineRole543B9670",
"Arn"
]
}
},
"DependsOn": [
"StateMachineRoleDefaultPolicyDA5F7DA8",
"StateMachineRole543B9670"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 406e66c

Please sign in to comment.