feat: Add customizable report filters to dashboard #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Documentation Issue | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| jobs: | |
| create-docs-issue: | |
| if: github.event.label.name == 'needs-docs' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: read | |
| steps: | |
| - name: Create documentation issue for PR | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const prTitle = pr.title; | |
| const prNumber = pr.number; | |
| const prUrl = pr.html_url; | |
| const prAuthor = pr.user.login; | |
| const issueTitle = `Docs: ${prTitle}`; | |
| const issueBody = ` | |
| Hi @docs-team 👋 | |
| This issue was automatically created for documentation related to the following PR: | |
| 🔗 **PR [#${prNumber}](${prUrl})** | |
| 👤 Opened by: @${prAuthor} | |
| Please assess and track any documentation updates required. | |
| --- | |
| _This issue was auto-generated by a GitHub Action._ | |
| `; | |
| const existingIssues = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: 'needs-docs', | |
| state: 'open' | |
| }); | |
| const alreadyExists = existingIssues.data.some(issue => | |
| issue.title.includes(`Docs: ${prTitle}`) | |
| ); | |
| if (!alreadyExists) { | |
| const { data: issue } = await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: issueTitle, | |
| body: issueBody, | |
| labels: ['documentation'] | |
| }); | |
| console.log(`✅ Documentation issue created: ${issue.html_url}`); | |
| } else { | |
| console.log('ℹ️ Documentation issue already exists for this PR. Skipping creation.'); | |
| } |