Skip to content

Commit 03aa9d5

Browse files
committed
add cicd actions
1 parent 26f9280 commit 03aa9d5

11 files changed

Lines changed: 1638 additions & 0 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Daily Lead Time Summary
2+
3+
on:
4+
# 手動実行を許可
5+
workflow_dispatch:
6+
# 毎日午前0時(UTC)に実行 = 日本時間午前9時
7+
schedule:
8+
- cron: '0 0 * * *'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
daily-leadtime-summary:
15+
name: Daily Lead Time Summary
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
pull-requests: read
20+
21+
steps:
22+
- name: Get yesterday's date range
23+
shell: bash
24+
run: |
25+
# 前日の日付範囲を取得
26+
start_time=$(date -u -d 'yesterday 00:00:00' +"%Y-%m-%d")
27+
end_time=$(date -u -d 'today 00:00:00' +"%Y-%m-%d")
28+
29+
echo "date_range=$start_time..$end_time"
30+
echo "date_range=$start_time..$end_time" >> "$GITHUB_ENV"
31+
echo "report_date=$start_time" >> "$GITHUB_ENV"
32+
33+
- name: Run issue-metrics tool
34+
uses: github/issue-metrics@v3
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
# 自分のリポジトリに変更してください
38+
SEARCH_QUERY: 'repo:github/issue-metrics is:pr merged:${{ env.date_range }}'
39+
HIDE_AUTHOR: false
40+
HIDE_TIME_TO_FIRST_RESPONSE: false
41+
HIDE_TIME_TO_CLOSE: false
42+
HIDE_TIME_TO_ANSWER: true
43+
HIDE_LABEL_METRICS: true
44+
HIDE_ITEMS_CLOSED_COUNT: false
45+
REPORT_TITLE: 'Daily Lead Time Report - ${{ env.report_date }}'
46+
47+
- name: Create daily summary issue
48+
uses: peter-evans/create-issue-from-file@v5
49+
with:
50+
title: '📊 Daily Lead Time Report - ${{ env.report_date }}'
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
content-filepath: ./issue_metrics.md
53+
labels: |
54+
metrics
55+
daily-report
56+
automated
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Full Lead Time Analysis (Draft to Merge)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# 毎週月曜日の午前9時(UTC)に実行
7+
- cron: '0 9 * * 1'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
full-leadtime-analysis:
14+
name: Complete Lead Time Analysis
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: read
19+
20+
steps:
21+
- name: Get last week's date range
22+
shell: bash
23+
run: |
24+
start_time=$(date -u -d 'last monday -7 days' +"%Y-%m-%d")
25+
end_time=$(date -u -d 'last monday' +"%Y-%m-%d")
26+
27+
echo "date_range=$start_time..$end_time" >> "$GITHUB_ENV"
28+
echo "start_date=$start_time" >> "$GITHUB_ENV"
29+
echo "end_date=$end_time" >> "$GITHUB_ENV"
30+
31+
- name: Run full lead time metrics
32+
uses: github/issue-metrics@v3
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
# 自分のリポジトリに変更してください
36+
SEARCH_QUERY: 'repo:github/issue-metrics is:pr merged:${{ env.date_range }}'
37+
38+
# === フルリードタイム計測 ===
39+
40+
# ドラフトからマージまでの全期間を追跡
41+
DRAFT_PR_TRACKING: true
42+
43+
# レビュープロセスの各段階を計測(あなたのラベルに変更してください)
44+
LABELS_TO_MEASURE: 'in-review,needs-changes,approved,qa-testing,ready-to-deploy'
45+
46+
# === すべてのメトリクスを表示 ===
47+
HIDE_TIME_TO_FIRST_RESPONSE: false # レビュー開始までの時間
48+
HIDE_TIME_TO_CLOSE: false # 全体のリードタイム
49+
HIDE_LABEL_METRICS: false # 各ステージの滞在時間
50+
HIDE_PR_STATISTICS: false # レビューコメント統計
51+
HIDE_ITEMS_CLOSED_COUNT: false # 完了したPR数
52+
53+
# === 表示項目 ===
54+
HIDE_AUTHOR: false # 作成者を表示
55+
HIDE_ASSIGNEE: false # アサイニーを表示
56+
HIDE_STATUS: false # ステータスを表示
57+
HIDE_CREATED_AT: false # 作成日時を表示
58+
59+
# === ボットとテストユーザーを除外 ===
60+
IGNORE_USERS: 'dependabot[bot],github-actions[bot],renovate[bot]'
61+
62+
REPORT_TITLE: 'Complete Lead Time Analysis - ${{ env.start_date }} to ${{ env.end_date }}'
63+
64+
- name: Create detailed report issue
65+
uses: peter-evans/create-issue-from-file@v5
66+
with:
67+
title: '📊 Weekly Lead Time Analysis - ${{ env.start_date }} to ${{ env.end_date }}'
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
content-filepath: ./issue_metrics.md
70+
labels: |
71+
metrics
72+
lead-time
73+
weekly-report
74+
automated
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Lead Time Metrics (Every 10 minutes)
2+
3+
on:
4+
# 手動実行を許可
5+
workflow_dispatch:
6+
# 10分ごとに実行 (cron形式: 分 時 日 月 曜日)
7+
schedule:
8+
- cron: '*/10 * * * *'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
leadtime-metrics:
15+
name: Calculate Lead Time Metrics
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
pull-requests: read
20+
21+
steps:
22+
- name: Get time range for last 10 minutes
23+
shell: bash
24+
run: |
25+
# 現在時刻と10分前の時刻を取得
26+
end_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
27+
start_time=$(date -u -d '10 minutes ago' +"%Y-%m-%dT%H:%M:%SZ")
28+
29+
# GitHub Actions環境変数に設定
30+
echo "time_range=$start_time..$end_time"
31+
echo "time_range=$start_time..$end_time" >> "$GITHUB_ENV"
32+
echo "start_time=$start_time" >> "$GITHUB_ENV"
33+
echo "end_time=$end_time" >> "$GITHUB_ENV"
34+
35+
- name: Run issue-metrics tool
36+
uses: github/issue-metrics@v3
37+
env:
38+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
# 以下のSEARCH_QUERYを自分のリポジトリに合わせて変更してください
40+
# 例: 'repo:owner/repo is:pr merged:${{ env.time_range }}'
41+
# PRのリードタイムを計測する場合(作成からマージまで)
42+
SEARCH_QUERY: 'repo:github/issue-metrics is:pr merged:${{ env.time_range }}'
43+
# 以下のオプションで表示内容をカスタマイズできます
44+
HIDE_AUTHOR: false
45+
HIDE_TIME_TO_FIRST_RESPONSE: false
46+
HIDE_TIME_TO_CLOSE: false
47+
HIDE_TIME_TO_ANSWER: true
48+
HIDE_LABEL_METRICS: true
49+
REPORT_TITLE: 'Lead Time Metrics - ${{ env.start_time }} to ${{ env.end_time }}'
50+
51+
- name: Create issue with metrics
52+
uses: peter-evans/create-issue-from-file@v5
53+
with:
54+
title: 'Lead Time Report - ${{ env.start_time }}'
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
content-filepath: ./issue_metrics.md
57+
labels: |
58+
metrics
59+
automated
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Review Process Metrics (Label Tracking)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# 毎日午前0時(UTC)に実行
7+
- cron: '0 0 * * *'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
review-process-metrics:
14+
name: Review Process with Label Tracking
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: read
19+
20+
steps:
21+
- name: Get yesterday's date range
22+
shell: bash
23+
run: |
24+
start_time=$(date -u -d 'yesterday 00:00:00' +"%Y-%m-%d")
25+
end_time=$(date -u -d 'today 00:00:00' +"%Y-%m-%d")
26+
27+
echo "date_range=$start_time..$end_time" >> "$GITHUB_ENV"
28+
echo "report_date=$start_time" >> "$GITHUB_ENV"
29+
30+
- name: Run issue-metrics with label tracking
31+
uses: github/issue-metrics@v3
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# 自分のリポジトリに変更してください
35+
SEARCH_QUERY: 'repo:github/issue-metrics is:pr merged:${{ env.date_range }}'
36+
37+
# レビュープロセスの各段階を計測
38+
# 以下のラベル名は、あなたのリポジトリで使用しているものに変更してください
39+
LABELS_TO_MEASURE: 'awaiting-review,changes-requested,approved,ready-to-merge'
40+
41+
# 表示設定
42+
HIDE_LABEL_METRICS: false # ラベルメトリクスを表示
43+
HIDE_TIME_TO_FIRST_RESPONSE: false # 初回レビューまでの時間を表示
44+
HIDE_TIME_TO_CLOSE: false # マージまでの時間を表示
45+
HIDE_PR_STATISTICS: false # レビューコメント統計を表示
46+
DRAFT_PR_TRACKING: true # ドラフト期間も追跡
47+
48+
# ボットを除外
49+
IGNORE_USERS: 'dependabot[bot],github-actions[bot],renovate[bot]'
50+
51+
REPORT_TITLE: 'Review Process Metrics with Label Tracking - ${{ env.report_date }}'
52+
53+
- name: Create issue
54+
uses: peter-evans/create-issue-from-file@v5
55+
with:
56+
title: '🔍 Review Process Report - ${{ env.report_date }}'
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
content-filepath: ./issue_metrics.md
59+
labels: |
60+
metrics
61+
review-process
62+
automated
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Customer Support Metrics
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# 毎日午前10時(UTC)に実行 = 日本時間午後7時
7+
- cron: '0 10 * * *'
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
support-metrics:
14+
name: Customer Support Response Metrics
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: read
19+
20+
steps:
21+
- name: Get yesterday's date range
22+
shell: bash
23+
run: |
24+
start_time=$(date -u -d 'yesterday 00:00:00' +"%Y-%m-%d")
25+
end_time=$(date -u -d 'today 00:00:00' +"%Y-%m-%d")
26+
27+
echo "date_range=$start_time..$end_time" >> "$GITHUB_ENV"
28+
echo "report_date=$start_time" >> "$GITHUB_ENV"
29+
30+
- name: Run support metrics for issues
31+
uses: github/issue-metrics@v3
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# 自分のリポジトリと、使用しているサポートラベルに変更してください
35+
SEARCH_QUERY: 'repo:github/issue-metrics is:issue label:customer-support created:${{ env.date_range }}'
36+
37+
# === サポート対応メトリクス ===
38+
HIDE_TIME_TO_FIRST_RESPONSE: false # 初回応答時間(重要!)
39+
HIDE_TIME_TO_CLOSE: false # 解決までの時間
40+
41+
# ステータスラベルでの滞在時間を計測
42+
LABELS_TO_MEASURE: 'investigating,waiting-for-customer,resolved'
43+
HIDE_LABEL_METRICS: false
44+
45+
# === サポートチームの活動度 ===
46+
ENABLE_MENTOR_COUNT: true # アクティブなサポート担当者数
47+
MIN_MENTOR_COMMENTS: 3 # 3コメント以上で担当者とみなす
48+
49+
# === 表示設定 ===
50+
HIDE_AUTHOR: false # 報告者を表示
51+
HIDE_ASSIGNEE: false # 担当者を表示
52+
HIDE_ITEMS_CLOSED_COUNT: false # 解決した問題数
53+
54+
# ボットを除外
55+
IGNORE_USERS: 'github-actions[bot]'
56+
57+
REPORT_TITLE: 'Customer Support Metrics - ${{ env.report_date }}'
58+
59+
- name: Create support metrics issue
60+
uses: peter-evans/create-issue-from-file@v5
61+
with:
62+
title: '🎫 Support Metrics Report - ${{ env.report_date }}'
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
content-filepath: ./issue_metrics.md
65+
labels: |
66+
metrics
67+
support
68+
daily-report
69+
automated
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Weekly Lead Time Report
2+
3+
on:
4+
# 手動実行を許可
5+
workflow_dispatch:
6+
# 毎週月曜日の午前0時(UTC)に実行
7+
schedule:
8+
- cron: '0 0 * * 1'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
weekly-leadtime-report:
15+
name: Weekly Lead Time Report
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
pull-requests: read
20+
21+
steps:
22+
- name: Get last week's date range
23+
shell: bash
24+
run: |
25+
# 先週の月曜日から日曜日までの範囲を取得
26+
start_time=$(date -u -d 'last monday -7 days' +"%Y-%m-%d")
27+
end_time=$(date -u -d 'last monday' +"%Y-%m-%d")
28+
29+
echo "date_range=$start_time..$end_time"
30+
echo "date_range=$start_time..$end_time" >> "$GITHUB_ENV"
31+
echo "start_date=$start_time" >> "$GITHUB_ENV"
32+
echo "end_date=$end_time" >> "$GITHUB_ENV"
33+
34+
- name: Run issue-metrics tool
35+
uses: github/issue-metrics@v3
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
# 自分のリポジトリに変更してください
39+
SEARCH_QUERY: 'repo:github/issue-metrics is:pr merged:${{ env.date_range }}'
40+
HIDE_AUTHOR: false
41+
HIDE_TIME_TO_FIRST_RESPONSE: false
42+
HIDE_TIME_TO_CLOSE: false
43+
HIDE_TIME_TO_ANSWER: true
44+
HIDE_LABEL_METRICS: true
45+
HIDE_ITEMS_CLOSED_COUNT: false
46+
HIDE_PR_STATISTICS: false # PR統計情報を表示
47+
DRAFT_PR_TRACKING: true # ドラフトPRも追跡
48+
REPORT_TITLE: 'Weekly Lead Time Report - ${{ env.start_date }} to ${{ env.end_date }}'
49+
50+
- name: Create weekly summary issue
51+
uses: peter-evans/create-issue-from-file@v5
52+
with:
53+
title: '📈 Weekly Lead Time Report - ${{ env.start_date }} to ${{ env.end_date }}'
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
content-filepath: ./issue_metrics.md
56+
labels: |
57+
metrics
58+
weekly-report
59+
automated

0 commit comments

Comments
 (0)