Change all r" to re.escape
#129
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: Manage issues | |
| on: | |
| issues: | |
| types: [opened, reopened, labeled, unlabeled] | |
| jobs: | |
| validate-issue-labels: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const requiredLabels = ["chore", "docs", "tests", "feature", "bug", "refactoring"]; | |
| const labels = (context.payload.issue.labels || []).map((l) => l.name); | |
| const hasType = labels.some((name) => requiredLabels.includes(name)); | |
| if (!hasType) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| body: [ | |
| "This issue is missing a required label.", | |
| "", | |
| "Please add at least one of:", | |
| `- ${requiredLabels.join("\n- ")}`, | |
| "", | |
| `Current labels: ${labels.length ? labels.join(", ") : "(none)"}`, | |
| ].join("\n"), | |
| }); | |
| core.notice("Missing required issue labels. A comment was posted on the issue."); | |
| } |