Files
Brian Murray 712628a973 Update GH action to publish monthly issue metrics (#6654)
* Update issue-metrics.yml
2024-07-12 10:14:38 -05:00

48 lines
1.5 KiB
YAML

# 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: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
report_date_start:
description: "Report date start(01/01/2024)"
required: false
report_date_end:
description: "Report date end(11/07/2024)"
required: false
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=${{ inputs.report_date_start }} >> "$GITHUB_ENV"
# Calculate the last day of the previous month
last_day=${{ inputs.report_date_end }} >> "$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 created:${{ env.first_day }}..${{ env.last_day }}'
- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report ${{ env.first_day }} to ${{ env.last_day }}
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md