[BUG]: WiFi connection keeps disconnecting on host #73
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: Clown Filter | |
| on: | |
| issues: | |
| types: [opened, edited] | |
| jobs: | |
| filter: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Check for Clowns | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = context.payload.issue.body; | |
| const clownStrings = [ | |
| "I admit that I am a clown", | |
| "I admit I did zero research" | |
| ]; | |
| // In YAML templates, checked boxes are usually rendered as [x] or [X] | |
| const isClownChecked = clownStrings.some(s => { | |
| const regex = new RegExp(`\\[[xX]\\]\\s*${s}`, "i"); | |
| return regex.test(body); | |
| }); | |
| if (isClownChecked) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| body: "🤡 **Clown detected.** \n\nYou admitted to being a clown or not reading the rules. This issue is being closed immediately. Honk honk! 🧤" | |
| }); | |
| try { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| labels: ['clown'] | |
| }); | |
| } catch (e) { | |
| // Label might not exist, that's fine | |
| } | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| state: 'closed', | |
| state_reason: 'not_planned' | |
| }); | |
| } |