-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add weekly workflow for github issues/pr metrics #29444
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e770d03
chore: add weekly workflow for github issues/pr metrics
paulhcsun e12bee9
Merge branch 'main' into weekly-repo-metrics
paulhcsun fe9da9a
add extra line space
paulhcsun 82eea8a
update variables
paulhcsun 7630192
update dates in shell script
paulhcsun 5d334a6
update bash script
paulhcsun 638d356
Merge branch 'main' into weekly-repo-metrics
mergify[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker. Would like to know is it normal and safe to use third party github actions for aws owned repos? As I can see this action is not from a
Verified creator
label which usually GITHUB does.peter-evans/create-issue-from-file@v5 -> https://github.com/marketplace/actions/create-issue-from-file
Sample verified action: https://github.com/marketplace/actions/checkout