@@ -15,24 +15,23 @@ jobs:
1515 with :
1616 python-version : ' 3.10'
1717
18- - name : Install dependencies
19- run : pip install PyGithub
20-
2118 - name : Create standardization script
2219 run : |
2320 cat > standardize_titles.py << 'EOF'
2421 import os
22+ import requests
2523 import time
26- from github import Github
2724
2825 # Authentication
2926 token = os.environ.get("GITHUB_TOKEN")
30- g = Github(token)
27+ headers = {
28+ "Accept": "application/vnd.github.v3+json",
29+ "Authorization": f"token {token}"
30+ }
3131
3232 # Repository details
3333 repo_owner = os.environ.get("REPO_OWNER")
3434 repo_name = os.environ.get("REPO_NAME")
35- repo = g.get_repo(f"{repo_owner}/{repo_name}")
3635
3736 # Issue updates mapping
3837 issue_updates = [
@@ -57,16 +56,26 @@ jobs:
5756 new_title = update["title"]
5857
5958 print(f"Updating issue #{issue_number} with title: {new_title}")
60- issue = repo.get_issue(issue_number)
61- issue.edit(title=new_title)
62- print(f"Successfully updated issue #{issue_number}")
59+
60+ url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/issues/{issue_number}"
61+ payload = {"title": new_title}
62+
63+ response = requests.patch(url, json=payload, headers=headers)
64+
65+ if response.status_code == 200:
66+ print(f"Successfully updated issue #{issue_number}")
67+ else:
68+ print(f"Error updating issue #{issue_number}: {response.status_code} - {response.text}")
6369
6470 # Add a short delay to avoid rate limiting
6571 time.sleep(1)
6672 except Exception as e:
6773 print(f"Error updating issue #{issue_number}: {str(e)}")
6874 EOF
6975
76+ - name : Install dependencies
77+ run : pip install requests
78+
7079 - name : Run standardization script
7180 env :
7281 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments