From 3dbab05e4e931d23648728d0fc3a0ac241ab5d8d Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:02:54 -0600 Subject: [PATCH] ci(actions): Refine the GitHub Actions workflow files. --- .../\360\237\220\233-bug-report.md" | 50 +++++++++---------- .../\360\237\222\241-feature-request.md" | 20 ++++---- .../\360\237\224\204-refactor-Improvement.md" | 19 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 29 ++++++----- .github/workflows/close-stale-issues-prs.yml | 24 --------- .github/workflows/label-pr-based-on-paths.yml | 24 ++++----- .github/workflows/label-pr-size.yml | 12 ++--- 7 files changed, 88 insertions(+), 90 deletions(-) create mode 100644 ".github/ISSUE_TEMPLATE/\360\237\224\204-refactor-Improvement.md" delete mode 100644 .github/workflows/close-stale-issues-prs.yml diff --git "a/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" "b/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" index 24630a5..cf2388a 100644 --- "a/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" +++ "b/.github/ISSUE_TEMPLATE/\360\237\220\233-bug-report.md" @@ -1,41 +1,39 @@ --- -name: "\U0001F41B Bug report" -about: Create a report to help us improve +name: '🐛 Bug report' +about: Report an issue to improve the functionality and usability of the project. title: '[BUG]' labels: bug assignees: ZL-Asica --- -**Describe the bug** -A clear and concise description of what the bug is. +**Description:** +Provide a clear and concise description of the issue. -**To Reproduce** -Steps to reproduce the behavior: +**Steps to Reproduce:** -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +1. Navigate to `...` +2. Perform action `...` +3. Observe the behavior `...` -**Expected behavior** -A clear and concise description of what you expected to happen. +**Expected Behavior:** +Describe what you expected to happen. -**Screenshots** -If applicable, add screenshots to help explain your problem. +**Screenshots/Visuals:** +Attach any screenshots that demonstrate the problem. -**Desktop (please complete the following information):** +**System Details:** -- OS: [e.g. macOS] -- Browser [e.g. chrome, safari] -- Version [e.g. 22] -- Network physical location [e.g. U.S., China (Mainland) +- **OS**: (e.g., macOS Ventura) +- **Browser**: (e.g., Chrome 118.0) +- **Version**: (e.g., v1.2.3) +- **Network**: (e.g., U.S., Mainland China) -**Smartphone (please complete the following information):** +**Mobile Environment:** -- Device: [e.g. iPhone 16] -- OS: [e.g. iOS 18.1] -- Browser [e.g. stock browser, safari] -- Version [e.g. 22] +- **Device**: (e.g., iPhone 15) +- **OS**: (e.g., iOS 18) +- **Browser**: (e.g., Safari) +- **Version**: (e.g., v18.3.2) -**Additional context** -Add any other context about the problem here. +**Additional Context:** +Add any extra information here, including related configuration or debugging attempts. diff --git "a/.github/ISSUE_TEMPLATE/\360\237\222\241-feature-request.md" "b/.github/ISSUE_TEMPLATE/\360\237\222\241-feature-request.md" index 7fa7be3..a40d5cc 100644 --- "a/.github/ISSUE_TEMPLATE/\360\237\222\241-feature-request.md" +++ "b/.github/ISSUE_TEMPLATE/\360\237\222\241-feature-request.md" @@ -1,19 +1,19 @@ --- -name: "\U0001F4A1 Feature request" -about: Suggest an idea for this project +name: '💡 Feature request' +about: Propose new features or improvements to enhance the project. title: '[Feature]' labels: enhancement assignees: '' --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +**Problem/Background:** +Explain the motivation behind this feature and any existing limitations. -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +**Proposed Solution:** +Describe the desired feature in detail, including UI/UX suggestions if applicable. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Alternatives Considered:** +List any alternative approaches or previous solutions considered. -**Additional context** -Add any other context or screenshots about the feature request here. +**Additional Context:** +Provide any other relevant context, visuals, or references. diff --git "a/.github/ISSUE_TEMPLATE/\360\237\224\204-refactor-Improvement.md" "b/.github/ISSUE_TEMPLATE/\360\237\224\204-refactor-Improvement.md" new file mode 100644 index 0000000..f286889 --- /dev/null +++ "b/.github/ISSUE_TEMPLATE/\360\237\224\204-refactor-Improvement.md" @@ -0,0 +1,19 @@ +--- +name: '🔄 Refactor/Improvement' +about: Suggest code, structure, or performance optimizations. +title: '[Refactor]' +labels: enhancemanet +assignees: ZL-Asica +--- + +**Description:** +Describe what you’d like to refactor or improve, linking to specific files/components. + +**Impact:** +Explain how this change will improve the project (e.g., maintainability, readability, or performance). + +**Suggested Approach:** +Outline an approach or provide a sample refactored code snippet. + +**Related PRs/Commits:** +Link to relevant code or previous attempts at refactoring. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index abae7cc..a9d6065 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,19 +1,24 @@ ## Description -Please include a summary of the changes and the related issue. +Provide a concise summary of the changes, the motivation behind them, and a link to any relevant issues. -## Type of change +## Type of Change -- [ ] Bug fix -- [ ] New feature -- [ ] Code refactor -- [ ] Breaking change -- [ ] Style update -- [ ] Documentation update +Select all options that apply to this pull request: + +- [ ] 🐛 Bug fix +- [ ] ✨ New feature +- [ ] 🛠 Code refactor +- [ ] ⚠️ Breaking change +- [ ] 🎨 Style update +- [ ] 📚 Documentation update ## Checklist -- [ ] I have performed a self-review of my code -- [ ] Single file within 200 lines of codes -- [ ] Comments has added -- [ ] My changes generate no new warnings +Before submitting, please confirm the following: + +- [ ] I have performed a self-review of my code. +- [ ] The main changes are limited to single files, ideally within 200 lines. +- [ ] Clear and concise comments have been added where necessary. +- [ ] My changes do not introduce any new warnings or errors in the codebase. +- [ ] Any dependencies have been updated in `package.json` and documented. diff --git a/.github/workflows/close-stale-issues-prs.yml b/.github/workflows/close-stale-issues-prs.yml deleted file mode 100644 index e997f87..0000000 --- a/.github/workflows/close-stale-issues-prs.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Close stale issues and PRs - -on: - schedule: - - cron: '0 0 * * *' # Adjust the cron schedule as needed - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - name: Close stale issues and PRs - uses: actions/stale@v9 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale due to inactivity.' - stale-pr-message: 'This PR has been automatically marked as stale due to inactivity.' - days-before-stale: 30 - days-before-close: 7 - stale-issue-label: 'Stale' - stale-pr-label: 'Stale' - exempt-issue-labels: 'bug,documentation' - exempt-pr-labels: 'WIP' - exempt-all-milestones: true - exempt-all-pr-assignees: true # Exempt all PRs with any assignee diff --git a/.github/workflows/label-pr-based-on-paths.yml b/.github/workflows/label-pr-based-on-paths.yml index 5123992..703b3d0 100644 --- a/.github/workflows/label-pr-based-on-paths.yml +++ b/.github/workflows/label-pr-based-on-paths.yml @@ -26,13 +26,13 @@ jobs: }); const labelsToColor = { - main: 'f66a0a', // Orange + 'main': 'f66a0a', // Orange 'common-components': '1f77b4', // Blue - layout: '8c564b', // Brown - service: '2ca02c', // Green - styles: '9467bd', // Purple - content: 'ffdd57', // Yellow - types: 'd62728', // Red + 'posts': '8c564b', // Brown + 'service': '2ca02c', // Green + 'styles': '9467bd', // Purple + 'content': 'ffdd57', // Yellow + 'types': 'd62728', // Red }; const labels = new Set(); @@ -41,22 +41,22 @@ jobs: if (file.filename.startsWith('src/app')) { labels.add('main'); } - if (file.filename.startsWith('src/components/layout')) { - labels.add('layout'); + if (file.filename.startsWith('src/components/posts')) { + labels.add('posts'); } if (file.filename.startsWith('src/components/common')) { labels.add('common-components'); } - if (file.filename.startsWith('src/service')) { - labels.add('service'); + if (file.filename.startsWith('src/services')) { + labels.add('services'); } - if (file.filename.startsWith('src/styles')) { + if (file.filename.endsWith('.css')) { labels.add('styles'); } if (file.filename.startsWith('posts')) { labels.add('content'); } - if (file.filename.startsWith('src/types.d.ts')) { + if (file.filename.startsWith('src/types.d.ts') || file.filename.endsWith('.d.ts')) { labels.add('types'); } }); diff --git a/.github/workflows/label-pr-size.yml b/.github/workflows/label-pr-size.yml index 70e47f6..def31d5 100644 --- a/.github/workflows/label-pr-size.yml +++ b/.github/workflows/label-pr-size.yml @@ -21,12 +21,12 @@ jobs: with: sizes: > { - "0": "XS", - "20": "S", - "50": "M", - "200": "L", - "800": "XL", - "2000": "XXL" + "0": XS, + "20": S, + "50": M, + "200": L, + "800": XL, + "2000": XXL, } - name: Set label colors