Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
AMZ-brandon authored Mar 15, 2024
2 parents 0da83c4 + 7958117 commit b35229b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/issue-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow searches for issues/pull requests/discussions in a repository, measures several metrics,
# and generates a report in form of a GitHub issue.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/marketplace/actions/issue-metrics

name: Monthly issue metrics
on:
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'

permissions:
issues: write
pull-requests: read

jobs:
build:
name: Issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:awsdocs/aws-doc-sdk-examples is:issue created:${{ env.last_month }} -reason:"not planned"'

- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report ${{ env.last_month }}
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
2 changes: 1 addition & 1 deletion .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
run: |
changed_files=(${{steps.changed-files.outputs.all_changed_files}})
npm run --prefix javascriptv3 ci-lint -- ${changed_files[@]//javascriptv3\/}
./javascriptv3/github_scripts/lint.sh "${changed_files[@]}"
18 changes: 18 additions & 0 deletions .github/workflows/pr_stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pull Request Stats

on:
workflow_dispatch:

jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
organization: 'piedpiper'
period: 7
charts: true
disableLinks: true
sortBy: 'COMMENTS'
14 changes: 14 additions & 0 deletions javascriptv3/github_scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# Filter out JSON files
filtered_files=()
for file in "$@"; do
if [[ "$file" != *"javascriptv3/"*.json ]]; then
filtered_files+=("$file")
fi
done

# Run linting only on filtered files
npm run --prefix javascriptv3 ci-lint -- "${filtered_files[@]//javascriptv3\/}"

0 comments on commit b35229b

Please sign in to comment.