|
1 | | -name: Triage report (reusable) |
2 | | - |
3 | | -# Reusable workflow that builds a scoped GitHub issue triage report and emails it. |
4 | | -# |
5 | | -# Scope is defined by any combination of: |
6 | | -# * areas - Area labels to include (e.g. "Area: Release, Area:RM") |
7 | | -# * owners - CODEOWNERS handles whose owned Tasks/ are included (e.g. "@manolerazvan") |
8 | | -# |
9 | | -# The report always renders to the run's job summary. Email is sent only when the |
10 | | -# SMTP_* secrets are provided, so this is safe to run before mail is configured. |
11 | | -# |
12 | | -# Call it from a per-team caller workflow (see triage-report-release-rm.yml) so |
13 | | -# several teams can reuse this engine with their own inputs and mail secrets. |
14 | | -# It can also be run directly via "Run workflow" (supply at least one of areas / |
15 | | -# owners); email is sent only if MAIL_TO + SMTP_SERVER secrets exist, otherwise |
16 | | -# the report is available in the run's job summary. |
17 | | - |
18 | | -on: |
19 | | - workflow_call: |
20 | | - inputs: |
21 | | - areas: |
22 | | - description: 'Comma-separated Area labels to include (e.g. "Area: Release, Area:RM")' |
23 | | - type: string |
24 | | - required: false |
25 | | - default: '' |
26 | | - owners: |
27 | | - description: 'Space/comma separated CODEOWNERS handles; their owned Tasks/ are in scope' |
28 | | - type: string |
29 | | - required: false |
30 | | - default: '' |
31 | | - report_title: |
32 | | - description: 'Report title / email subject prefix' |
33 | | - type: string |
34 | | - required: false |
35 | | - default: 'Triage Report' |
36 | | - top_tasks: |
37 | | - description: 'How many top tasks to list' |
38 | | - type: string |
39 | | - required: false |
40 | | - default: '12' |
41 | | - weeks: |
42 | | - description: 'Number of trailing weeks for the dynamics columns' |
43 | | - type: string |
44 | | - required: false |
45 | | - default: '4' |
46 | | - secrets: |
47 | | - MAIL_TO: |
48 | | - required: false |
49 | | - MAIL_FROM: |
50 | | - required: false |
51 | | - SMTP_SERVER: |
52 | | - required: false |
53 | | - SMTP_PORT: |
54 | | - required: false |
55 | | - SMTP_USERNAME: |
56 | | - required: false |
57 | | - SMTP_PASSWORD: |
58 | | - required: false |
59 | | - SMTP_SECURE: |
60 | | - required: false |
61 | | - workflow_dispatch: |
62 | | - inputs: |
63 | | - areas: |
64 | | - description: 'Comma-separated Area labels to include (e.g. "Area: Release, Area:RM")' |
65 | | - type: string |
66 | | - required: false |
67 | | - default: '' |
68 | | - owners: |
69 | | - description: 'Space/comma separated CODEOWNERS handles; their owned Tasks/ are in scope' |
70 | | - type: string |
71 | | - required: false |
72 | | - default: '' |
73 | | - report_title: |
74 | | - description: 'Report title / email subject prefix' |
75 | | - type: string |
76 | | - required: false |
77 | | - default: 'Triage Report' |
78 | | - top_tasks: |
79 | | - description: 'How many top tasks to list' |
80 | | - type: string |
81 | | - required: false |
82 | | - default: '12' |
83 | | - weeks: |
84 | | - description: 'Number of trailing weeks for the dynamics columns' |
85 | | - type: string |
86 | | - required: false |
87 | | - default: '4' |
88 | | - |
89 | | -permissions: |
90 | | - issues: read |
91 | | - contents: read |
92 | | - |
93 | | -jobs: |
94 | | - triage-report: |
95 | | - runs-on: ubuntu-latest |
96 | | - name: Build and send triage report |
97 | | - steps: |
98 | | - - name: Check out repository |
99 | | - uses: actions/checkout@v4 |
100 | | - |
101 | | - # Install runtime deps from the PUBLIC npm registry in an isolated |
102 | | - # directory, avoiding the repo's private-feed .npmrc (a root install |
103 | | - # against the private feed produces npm E401). |
104 | | - - name: Install dependencies (public registry) |
105 | | - run: | |
106 | | - mkdir -p "$RUNNER_TEMP/triage" |
107 | | - cd "$RUNNER_TEMP/triage" |
108 | | - echo "registry=https://registry.npmjs.org/" > .npmrc |
109 | | - npm install --no-save --registry=https://registry.npmjs.org/ @octokit/rest@18.12.0 nodemailer@6 |
110 | | -
|
111 | | - - name: Generate and send report |
112 | | - run: node ci/triage-report.js |
113 | | - env: |
114 | | - NODE_PATH: ${{ runner.temp }}/triage/node_modules |
115 | | - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
116 | | - AREAS: ${{ inputs.areas }} |
117 | | - OWNERS: ${{ inputs.owners }} |
118 | | - REPORT_TITLE: ${{ inputs.report_title }} |
119 | | - TOP_TASKS: ${{ inputs.top_tasks }} |
120 | | - WEEKS: ${{ inputs.weeks }} |
121 | | - MAIL_TO: ${{ secrets.MAIL_TO }} |
122 | | - MAIL_FROM: ${{ secrets.MAIL_FROM }} |
123 | | - SMTP_SERVER: ${{ secrets.SMTP_SERVER }} |
124 | | - SMTP_PORT: ${{ secrets.SMTP_PORT }} |
125 | | - SMTP_USERNAME: ${{ secrets.SMTP_USERNAME }} |
126 | | - SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }} |
127 | | - SMTP_SECURE: ${{ secrets.SMTP_SECURE }} |
0 commit comments