From 9c52f012044d1aad1863bf623608e1c34d217097 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sun, 1 Dec 2024 21:28:37 +0100 Subject: [PATCH 1/3] remove redundant & outdated info in workflow (#3076) - stale + closing message contains outdated time - remove mention of how long it has been to simplify it. --- .github/workflows/close-old-issues.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index 43ef794e..ac6e372f 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -28,8 +28,8 @@ jobs: days-before-pr-stale: -1 days-before-pr-close: -1 # Sends a message for both the Stale and Close events of an issue. - stale-issue-message: "This issue was marked as stale because it has been inactive for 7 days" - close-issue-message: "This issue was closed because it has been inactive for 7 days since it was marked as stale" + stale-issue-message: "This issue was marked as stale due to inactivity." + close-issue-message: "This issue was closed after remaining stale without updates." # Increase this value if the project receives a lot of # PRs (yes.. apparently they're processed no matter what) & Issues. # Default value for it (according to the docs) is 30 From d48f212be4db9bb3f8735341f2730faa1f207ad7 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sun, 1 Dec 2024 21:29:04 +0100 Subject: [PATCH 2/3] [Issue Template] Add Validation (#3067) * issue template update - add issue validation inspired by https://github.com/ChrisTitusTech/linutil/pull/459 - standardize capitalisation of characters in titles - update feature request to use headers instead of bold text for titles * use "I checked" for Issue validation --- .github/ISSUE_TEMPLATE/bug_report.md | 10 +++++++--- .github/ISSUE_TEMPLATE/feature_request.md | 14 +++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c75d8a2a..063c005f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,12 +9,11 @@ assignees: '' ## Describe the bug -## To Reproduce -Steps to reproduce the behavior: +## Steps to reproduce 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' -4. See error +4. See the error. ## Expected behavior @@ -24,3 +23,8 @@ Steps to reproduce the behavior: ## Additional context + +## Issue validation +- [ ] I checked for duplicate issues. +- [ ] I checked for already existing discussions. +- [ ] I checked for an already existing pull request addressing the issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index a614d708..f9874142 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,17 +4,21 @@ about: Suggest an idea for this project title: '' labels: 'enhancement' assignees: '' - --- -**Is your feature request related to a problem? Please describe.** +## Is your feature request related to a problem? Please describe -**Describe the solution you'd like** +## Describe the solution you'd like -**Describe alternatives you've considered** +## Describe alternatives you've considered -**Additional context** +## Additional context + +## Issue validation +- [ ] I checked for duplicate issues. +- [ ] I checked for already existing discussions. +- [ ] I checked for an already existing pull request addressing the issue. From 0779dd90960e32fb68445c3c04d0d0cd5a273fc1 Mon Sep 17 00:00:00 2001 From: MyDrift Date: Sun, 1 Dec 2024 21:30:10 +0100 Subject: [PATCH 3/3] [CI/CD] Update Issue Commands (#3052) * update issue commands workflow - remove existing workflow - copy linutil's workflow into winutil - add @CodingWonders as allowed user * remove op from rights - op could spam and create a ton of new labels, or spam workflow to close, reopen and so one --- ...command.yaml => issue-slash-commands.yaml} | 60 ++++++++++++++++--- 1 file changed, 51 insertions(+), 9 deletions(-) rename .github/workflows/{close-issue-command.yaml => issue-slash-commands.yaml} (51%) diff --git a/.github/workflows/close-issue-command.yaml b/.github/workflows/issue-slash-commands.yaml similarity index 51% rename from .github/workflows/close-issue-command.yaml rename to .github/workflows/issue-slash-commands.yaml index e27ba51e..e8b36b4a 100644 --- a/.github/workflows/close-issue-command.yaml +++ b/.github/workflows/issue-slash-commands.yaml @@ -1,11 +1,11 @@ -name: Close issue on /close +name: Issue slash commands on: issue_comment: types: [created, edited] jobs: - closeIssueOnClose: + issueCommands: # Skip this job if the comment was created/edited on a PR if: ${{ !github.event.issue.pull_request }} runs-on: ubuntu-latest @@ -17,6 +17,30 @@ jobs: steps: - run: echo "command=false" >> $GITHUB_ENV + - name: Check for /label command + id: check_label_command + run: | + if [[ "${{ contains(github.event.comment.body, '/label') }}" == "true" ]]; then + echo "command=true" >> $GITHUB_ENV + LABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/label" '/\/label/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }') + echo "label_command=true" >> $GITHUB_ENV + echo "label_name=${LABEL_NAME}" >> $GITHUB_ENV + else + echo "label_command=false" >> $GITHUB_ENV + fi + + - name: Check for /unlabel command + id: check_unlabel_command + run: | + if [[ "${{ contains(github.event.comment.body, '/unlabel') }}" == "true" ]]; then + echo "command=true" >> $GITHUB_ENV + UNLABEL_NAME=$(echo "${{ github.event.comment.body }}" | awk -F"/unlabel" '/\/unlabel/ { match($2, /'\''([^'\'']*)'\''/, arr); if (arr[1] != "") print arr[1] }') + echo "unlabel_command=true" >> $GITHUB_ENV + echo "unlabel_name=${UNLABEL_NAME}" >> $GITHUB_ENV + else + echo "unlabel_command=false" >> $GITHUB_ENV + fi + - name: Check for /close command id: check_close_command run: | @@ -43,15 +67,15 @@ jobs: id: check_user if: env.command == 'true' run: | - ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC") + ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders") if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then echo "user=true" >> $GITHUB_ENV else - echo "user=false" >> $GITHUB_ENV + exit 0 fi - - name: Close issue if conditions are met - if: env.close_command == 'true' && env.user == 'true' + - name: Close issue + if: env.close_command == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_NUMBER: ${{ github.event.issue.number }} @@ -62,12 +86,30 @@ jobs: else gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} fi - - - name: Reopen issue if conditions are met - if: env.reopen_command == 'true' && env.user == 'true' + + - name: Reopen issue + if: env.reopen_command == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_NUMBER: ${{ github.event.issue.number }} run: | echo Reopening the issue... gh issue reopen $ISSUE_NUMBER --repo ${{ github.repository }} + + - name: Label issue + if: env.label_command == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: | + echo Labeling the issue... + gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --add-label "${{ env.label_name }}" + + - name: Remove labels + if: env.unlabel_command == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: | + echo Unlabeling the issue... + gh issue edit $ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "${{ env.unlabel_name }}" \ No newline at end of file