Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork370
Memory leak inVariableContextProvider when re-rendering with CSS variables#204
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:Validate Bug Report | |
| on: | |
| issues: | |
| types: | |
| -opened | |
| jobs: | |
| validate-issue: | |
| runs-on:ubuntu-latest | |
| steps: | |
| -name:Check for reproduction link | |
| uses:actions/github-script@v6 | |
| with: | |
| script:| | |
| const excludeLinks = [ | |
| 'https://github.com/nativewind/' | |
| ]; | |
| const reproductionKeywords = [ | |
| 'github.com' | |
| ]; | |
| // Helper function to get the base URL without query parameters or fragments | |
| function getBaseUrl(url) { | |
| try { | |
| const parsedUrl = new URL(url); | |
| return `${parsedUrl.origin}${parsedUrl.pathname}`; | |
| } catch { | |
| return url; | |
| } | |
| } | |
| const issueBody = context.payload.issue.body || ''; | |
| const issueBodyLower = issueBody.toLowerCase(); | |
| // Extract base URLs for comparison | |
| const issueLinks = issueBodyLower.match(/https?:\/\/[^\s)]+/g) || []; | |
| const issueBaseLinks = issueLinks.map(getBaseUrl); | |
| // Extract base URLs from excluded links | |
| const excludedBaseLinks = excludeLinks.map(link => getBaseUrl(link).toLowerCase()); | |
| // Check if the issue contains any of the excluded links only | |
| const hasOnlyExcludedLinks = issueBaseLinks.every(link => | |
| excludedBaseLinks.includes(link) | |
| ); | |
| // Check if there's a valid reproduction link | |
| const hasReproduction = reproductionKeywords.some(keyword => | |
| issueBaseLinks.some(link => link.includes(keyword)) | |
| ); | |
| console.log('hasReproduction: ', hasReproduction); | |
| console.log('hasOnlyExcludedLinks: ', hasOnlyExcludedLinks); | |
| if (!hasReproduction || hasOnlyExcludedLinks) { | |
| const issueNumber = context.payload.issue.number; | |
| const commentBody = `👋 Hi, thanks for opening this issue! However, it seems that you did not include a reproduction link.\n\nPlease update your issue with one of the following:\n- **GitHub repo link**: A repository demonstrating the issue.\n\nIssues without reproductions will not be reviewed and are automatically closed. You can refer to our [contribution guide](https://github.com/nativewind/nativewind/blob/main/contributing.md#opening-an-issue) for more information.\n\nIf you have additional details, feel free to re-open the issue after providing a valid reproduction link.\n\nIf you have a usage question, please use the [Discord](https://discord.gg/ypNakAFQ65) or [GitHub Discussions](https://github.com/nativewind/nativewind/discussions) instead.`; | |
| // Post the comment | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| body: commentBody | |
| }); | |
| // Add a 'needs reproduction' label | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| labels: ['needs reproduction'] | |
| }); | |
| // Close the issue | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issueNumber, | |
| state: 'closed' | |
| }); | |
| } |