Skip to content

Per-pulse issue metrics (Multi Repo) #8

Per-pulse issue metrics (Multi Repo)

Per-pulse issue metrics (Multi Repo) #8

Workflow file for this run

name: Per-pulse issue metrics (Multi Repo)
on:
workflow_dispatch:
permissions:
issues: write
pull-requests: read
jobs:
build:
name: issue metrics
runs-on: ubuntu-latest
steps:
- name: Calculate query
shell: bash
env:
GH_TOKEN: ${{ secrets.CANONICAL_READ_TOKEN }}
run: |
pulse_start=$(date -d "1 fortnight ago" +%Y-%m-%d)
today=$(date +%Y-%m-%d)
team='canonical/soleng-reviewers'
teammembers=$(gh api /orgs/canonical/teams/solutions-engineering/members | jq -r '.[].login')
author=''
for member in $teammembers; do
author="$author author:$member"
done
range="$pulse_start..$today"
query="type:pr org:canonical $author created:$range"
echo "$query"
echo "query=$query" >> "$GITHUB_ENV"
echo "range=$range" >> "$GITHUB_ENV"
- name: Get issue metrics
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: '${{ env.query }}'
HIDE_TIME_TO_ANSWER: 'true'
- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: 'Issue metrics report (${{ env.range }})'
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: aieri