Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
bar-chart-2

GitHub Action

summarize-issues

v2

summarize-issues

bar-chart-2

summarize-issues

GitHub Action that generates a Markdown summary of the issues in a repo

Installation

Copy and paste the following snippet into your .yml file.

              

- name: summarize-issues

uses: brcrista/summarize-issues@v2

Learn more about this action in brcrista/summarize-issues

Choose a version

Summarize Issues

GitHub Actions build badge

GitHub Action that generates a Markdown summary of the issues in a repo.

See a full example at https://github.com/brcrista/summarize-issues-test.

Example

name: Generate issues report

on:
  schedule:
    - cron: 0/50 * * * 1-5

env:
  OUTPUT_FILE_NAME: IssuesReport.md
  COMMITTER_EMAIL: [email protected]
  COMMITTER_NAME: Brian Cristante
  COMMITTER_USERNAME: brcrista

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - uses: brcrista/summarize-issues@v1
      with:
        title: 'My Issues Report'
        configPath: '.github/workflows/issues-report-config.json'
        outputPath: ${{ env.OUTPUT_FILE_NAME }}
        token: ${{ secrets.GITHUB_TOKEN }}

    - name: "Commit if any changes were made"
      run: |
        git remote add github "https://$COMMITTER_USERNAME:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
        git pull github ${GITHUB_REF} --ff-only
        if [[ `git status --porcelain` ]]; then
          git add ${OUTPUT_FILE_NAME}
          git config --global user.email $COMMITTER_EMAIL
          git config --global user.name $COMMITTER_NAME
          git commit -m "Update $OUTPUT_FILE_NAME"
          git push github HEAD:${GITHUB_REF}
        fi

where issues-report.json looks like:

[
  {
    "section": "Section with green status",
    "labels": ["incident-repair", "short-term"],
    "threshold": 10
  },
  {
    "section": "Section with yellow status",
    "labels": ["needs-triage"],
    "threshold": 2
  },
  {
    "section": "Section with red status",
    "labels": ["bug"],
    "threshold": 1
  }
]

This will commit a Markdown file named IssuesReport.md that looks like this:

### My Issues Report
### Summary
| Section Title | Labels | Threshold | Count | Status |
| -- | -- | -- | -- | -- |
| [Section with green status](#-Section-with-green-status-query) | `incident-repair`, `short-term` | 10 | 2 | πŸ’šπŸ₯³ |
| [Section with yellow status](#-Section-with-yellow-status-query) | `needs-triage` | 2 | 2 | πŸ’›πŸ˜¬ |
| [Section with red status](#-Section-with-red-status-query) | `bug` | 1 | 2 | ❀️πŸ₯΅ |
## Details
### πŸ’šπŸ₯³ Section with green status [(query)](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Aincident-repair+label%3Ashort-term)
Total: 2

Threshold: 10

Labels: `incident-repair`, `short-term`

| Owner | Count |
| -- | -- |
| [brcrista](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Aincident-repair+label%3Ashort-term+assignee%3Abrcrista) | 1 |
### πŸ’›πŸ˜¬ Section with yellow status [(query)](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Aneeds-triage)
Total: 2

Threshold: 2

Labels: `needs-triage`

| Owner | Count |
| -- | -- |
| [brcrista](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Aneeds-triage+assignee%3Abrcrista) | 1 |
### ❀️πŸ₯΅ Section with red status [(query)](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
Total: 2

Threshold: 1

Labels: `bug`

| Owner | Count |
| -- | -- |
| [brcrista](https://github.com/test/repo/issues?q=is%3Aissue+is%3Aopen+label%3Abug+assignee%3Abrcrista) | 1 |