Bug: Duplicate/Stacked Rich Text Editor Toolbars Appear When Clicking Calendar Day to Create Event #39
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: Auto-comment on Issues with Diagnostics Links | |
| # Triggers on newly opened issues | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| comment-on-issue: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Comment on bug reports | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const workspace = process.env.GITHUB_WORKSPACE || process.cwd(); | |
| // Read template files from the repository | |
| let bugComment = ''; | |
| let questionComment = ''; | |
| try { | |
| bugComment = fs.readFileSync(path.join(workspace, '.github/issue-comments/bug.md'), 'utf8'); | |
| } catch (e) { | |
| console.log('Could not read bug.md:', e.message); | |
| } | |
| try { | |
| questionComment = fs.readFileSync(path.join(workspace, '.github/issue-comments/question.md'), 'utf8'); | |
| } catch (e) { | |
| console.log('Could not read question.md:', e.message); | |
| } | |
| const labels = context.payload.issue.labels.map(l => l.name); | |
| const isBug = labels.includes('bug'); | |
| let comment = ''; | |
| if (isBug && bugComment) { | |
| comment = bugComment; | |
| } else if (labels.includes('question') && questionComment) { | |
| comment = questionComment; | |
| } | |
| if (comment) { | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }); | |
| } else { | |
| console.log('No comment template matched or templates missing.'); | |
| } |