|
| 1 | +name: Feature Request Custom Work Comment |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + issues: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + comment: |
| 13 | + if: >- |
| 14 | + ${{ |
| 15 | + github.event.issue.author_association != 'OWNER' && |
| 16 | + github.event.issue.author_association != 'MEMBER' && |
| 17 | + github.event.issue.author_association != 'COLLABORATOR' |
| 18 | + }} |
| 19 | + runs-on: ubuntu-latest |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Comment on enhancement requests from regular users |
| 23 | + uses: actions/github-script@v7 |
| 24 | + with: |
| 25 | + script: | |
| 26 | + const issueTypeQuery = ` |
| 27 | + query($owner: String!, $repo: String!, $issueNumber: Int!) { |
| 28 | + repository(owner: $owner, name: $repo) { |
| 29 | + issue(number: $issueNumber) { |
| 30 | + issueType { |
| 31 | + name |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | + `; |
| 37 | +
|
| 38 | + const issueTypeResult = await github.graphql(issueTypeQuery, { |
| 39 | + owner: context.repo.owner, |
| 40 | + repo: context.repo.repo, |
| 41 | + issueNumber: context.issue.number, |
| 42 | + }); |
| 43 | +
|
| 44 | + const issueTypeName = issueTypeResult.repository.issue?.issueType?.name?.trim().toLowerCase(); |
| 45 | + const hasFeatureLabel = context.payload.issue.labels.some( |
| 46 | + (label) => label.name.startsWith('Type: Feature') |
| 47 | + ); |
| 48 | +
|
| 49 | + if (issueTypeName !== 'enhancement' && !hasFeatureLabel) { |
| 50 | + core.info(`Skipping issue #${context.issue.number}. Issue type: ${issueTypeName ?? 'none'}.`); |
| 51 | + return; |
| 52 | + } |
| 53 | +
|
| 54 | + await github.rest.issues.createComment({ |
| 55 | + owner: context.repo.owner, |
| 56 | + repo: context.repo.repo, |
| 57 | + issue_number: context.issue.number, |
| 58 | + body: `Blazorise is continuously evolving, and we do review feature requests from the community. However, due to limited resources, not all requests can be prioritized or scheduled in the short term. |
| 59 | +
|
| 60 | +If this feature is critical for your project and you need it implemented on a specific timeline, we offer a custom development program where features can be prioritized and delivered in collaboration with you: |
| 61 | +https://blazorise.com/custom-work |
| 62 | + |
| 63 | +---`, |
| 64 | + }); |
0 commit comments