diff --git a/.github/ISSUE_TEMPLATE/challenge-submission.md b/.github/ISSUE_TEMPLATE/challenge-submission.md new file mode 100644 index 0000000..bba8435 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/challenge-submission.md @@ -0,0 +1,18 @@ +name: Challenge Submission +description: Submit your solution for a weekly challenge. +title: "[Week X] Challenge Submission - YOUR_USERNAME" +labels: challenge, submission +assignees: '' + +--- + +## Challenge Information + +- **Week:** [e.g., Week 1] +- **Challenge Name:** [Name of the challenge] + +## PR Link +- Please link your Pull Request for this challenge: [PR link] + +## Notes / Comments +- Any comments about your submission, difficulties, or questions. \ No newline at end of file diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml new file mode 100644 index 0000000..a24af22 --- /dev/null +++ b/.github/workflows/auto-label.yml @@ -0,0 +1,49 @@ +name: "Auto Label Issues & PRs" + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + labeler: + runs-on: ubuntu-latest + + steps: + - name: "Add Labels Automatically" + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue = context.payload.issue || context.payload.pull_request; + if (!issue) return; + + const labelsToAdd = []; + + // Auto-label PRs as challenge submissions if they include week-X in title + if (issue.title.match(/week-\d+/i)) { + labelsToAdd.push("challenge"); + } + + // Auto-label issues that include "question" + if (issue.title.toLowerCase().includes("question")) { + labelsToAdd.push("question"); + } + + // Auto-label issues that include "bug" + if (issue.title.toLowerCase().includes("bug")) { + labelsToAdd.push("bug"); + } + + if (labelsToAdd.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + labels: labelsToAdd, + }); + console.log("Labels added:", labelsToAdd.join(", ")); + } else { + console.log("No labels added for this issue/PR."); + } \ No newline at end of file