Repository: Kota-Karthik/twinTrim (language: python)

Issue:
Workflow - Auto Assign Unassign Issues


**What workflow needs to be updated?**  
The auto-assign workflow that triggers when an issue is opened or reopened.

**Describe the proposed changes**  
I propose the following changes to ensure the workflow functions correctly:
- Ensure the workflow assigns issues to the creator if they are not a collaborator when the issue is of type bug, enhancement, or test.
- The workflow should unassign the creator if there is no activity on the issue for one week.

**Motivation**  
The current workflow is not assigning issues as intended when they are created or reopened, which affects our issue management process. Having issues auto-assigned helps streamline our workflow, and ensuring they are unassigned after a week of inactivity helps keep our issue list manageable.

**Additional context**  
I have already implemented the workflow, but it isn't functioning as expected. Changes need to be made in `.github/workflows/auto_assign_issues.yml`. 

Please test the changes before raising a PR and add screenshots for verification.



Discussion / hints:
Hello, I want to try working on this could you assign it to me. Please do add the labels of GSSoCc-ext and hacktoberfest-accepted.
@Chin-may02 can you explain your approach first? like how're you going to achieve this? and also @Kota-Karthik here you go. 
I will update the flow to check the label and accurately identify them, assignment will only be done if they are not a collaborator 

Do I create a new file or edit the existing one ?


@Chin-may02 edit the existing one
Sure will do, could you please add the level for this issue 

Fix patch:
diff --git a/.github/workflows/auto_assign_issues.yml b/.github/workflows/auto_assign_issues.yml
index d22f1b7..5333c9e 100644
--- a/.github/workflows/auto_assign_issues.yml
+++ b/.github/workflows/auto_assign_issues.yml
@@ -17,10 +17,11 @@ jobs:
       - name: Check if issue uses specific labels
         id: label-check
         run: |
-          # Check if the issue labels contain 'bug', 'test', or 'enhancement'
+          # Convert JSON array to bash array
+          labels=(${{ toJson(github.event.issue.labels) }})
           label_matches=false
-          for label in "${{ github.event.issue.labels }}"; do
-            if [[ "$label" == "bug" || "$label" == "test" || "$label" == "enhancement" ]]; then
+          for label in "${labels[@]}"; do
+            if [[ "$label" == "\"bug\"" || "$label" == "\"test\"" || "$label" == "\"enhancement\"" ]]; then
               label_matches=true
               break
             fi


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index a2a8afb..a6b8baa 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,10 +14,10 @@ jobs:
 
     steps:
       - name: Checkout code
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3  
 
       - name: Set up Python
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4  
         with:
           python-version: '3.8'