diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9f332fb..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Bug report -about: Report any issues with the platform -title: '' -labels: bug -assignees: '' ---- - -Found a bug? Please fill out the sections below. 👍 - -### Issue Summary - -A summary of the issue. This needs to be a clear detailed-rich summary. - -### Steps to Reproduce - -1. (for example) Went to ... -2. Clicked on... -3. ... - -Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead? - -### Actual Results - -- What's happening right now that is different from what is expected - -### Expected Results - -- This is an ideal result that the system should get after the tests are performed - -### Technical details - -- Browser version, screen recording, console logs, network requests: You can make a recording with [Bird Eats Bug](https://birdeatsbug.com/). -- Node.js version -- Anything else that you think could be an issue. - -### Evidence - -- How was this tested? This is quite mandatory in terms of bugs. Providing evidence of your testing with screenshots or/and videos is an amazing way to prove the bug and a troubleshooting chance to find the solution. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..01c71d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,43 @@ +name: Bug Report +description: File a bug report +title: '[Bug]: ' +labels: ['bug'] + +body: + - type: textarea + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior + value: "1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n" + validations: + required: true + - type: textarea + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: Screenshots/Videos + description: Drag n Drop Screenshots or videos which would help us to view the bug visually + validations: + required: false + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + validations: + required: false + - type: checkboxes + attributes: + label: Please checkmark the following checklist + options: + - label: I make sure that similar issue is not opened + required: true diff --git a/.github/workflows/apply-issue-labels-to-pr.yml b/.github/workflows/apply-issue-labels-to-pr.yml new file mode 100644 index 0000000..30f1340 --- /dev/null +++ b/.github/workflows/apply-issue-labels-to-pr.yml @@ -0,0 +1,74 @@ +name: 'Apply issue labels to PR' + +on: + pull_request_target: + types: + - opened + +jobs: + label_on_pr: + runs-on: ubuntu-latest + + permissions: + contents: none + issues: read + pull-requests: write + + steps: + - name: Apply labels from linked issue to PR + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + async function getLinkedIssues(owner, repo, prNumber) { + const query = `query GetLinkedIssues($owner: String!, $repo: String!, $prNumber: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $prNumber) { + closingIssuesReferences(first: 10) { + nodes { + number + labels(first: 10) { + nodes { + name + } + } + } + } + } + } + }`; + + const variables = { + owner: owner, + repo: repo, + prNumber: prNumber, + }; + + const result = await github.graphql(query, variables); + return result.repository.pullRequest.closingIssuesReferences.nodes; + } + + const pr = context.payload.pull_request; + const linkedIssues = await getLinkedIssues( + context.repo.owner, + context.repo.repo, + pr.number + ); + + const labelsToAdd = new Set(); + for (const issue of linkedIssues) { + if (issue.labels && issue.labels.nodes) { + for (const label of issue.labels.nodes) { + labelsToAdd.add(label.name); + } + } + } + + if (labelsToAdd.size) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + labels: Array.from(labelsToAdd), + }); + }