Skip to content

Commit a5c8155

Browse files
authored
Merge branch 'main' into fix/package-json-description
2 parents 86f7f4f + b9a2556 commit a5c8155

29 files changed

+137
-3
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: Report a problem with the project
4+
title: "[BUG] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '...'
16+
3. See error
17+
18+
**Expected behavior**
19+
What you expected to happen.
20+
21+
**Screenshots**
22+
If applicable, add screenshots.
23+
24+
**Environment (please complete the following information):**
25+
- OS: [e.g. Windows 10]
26+
- Browser [e.g. chrome, safari]
27+
- Version [e.g. 22]
28+
29+
**Additional context**
30+
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Description
2+
3+
Please include a summary of the changes and the related issue.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Documentation update
10+
- [ ] Refactor
11+
- [ ] Other (please describe):
12+
13+
## How Has This Been Tested?
14+
15+
Please describe the tests that you ran to verify your changes. Include details of your testing environment if relevant.
16+
17+
## Checklist:
18+
19+
- [ ] My code follows the style guidelines of this project
20+
- [ ] I have performed a self-review of my code
21+
- [ ] I have commented my code where necessary
22+
- [ ] I have added tests that prove my fix is effective or that my feature works
23+
- [ ] New and existing unit tests pass locally with my changes
24+
- [ ] I have updated the documentation (if applicable)
25+
26+
## Related Issues
27+
28+
Fixes #<issue-number> (if applicable)

.github/workflows/gcal.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Create Google Calendar Event on Issue Assignment
2+
3+
on:
4+
issues:
5+
types: [assigned]
6+
7+
jobs:
8+
create-calendar-event:
9+
if: github.event.assignee.login != null
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install google-api-python-client google-auth google-auth-httplib2 google-auth-oauthlib
24+
25+
- name: Create Calendar Event
26+
env:
27+
GCAL_CREDENTIALS_JSON: ${{ secrets.GCAL_CREDENTIALS_JSON }}
28+
run: |
29+
import os
30+
import json
31+
import datetime
32+
import base64
33+
from google.oauth2 import service_account
34+
from googleapiclient.discovery import build
35+
36+
# Load GitHub event
37+
import yaml
38+
with open(os.environ['GITHUB_EVENT_PATH'], 'r') as f:
39+
event = yaml.safe_load(f)
40+
41+
assignee = event["assignee"]["login"]
42+
issue = event["issue"]
43+
title = issue["title"]
44+
url = issue["html_url"]
45+
body = issue.get("body", "")
46+
47+
# Try to extract a due date from the body (format: Due: YYYY-MM-DD)
48+
import re
49+
match = re.search(r"(?i)due[:\s]+(\d{4}-\d{2}-\d{2})", body)
50+
if not match:
51+
print("No due date found in issue body.")
52+
exit(0)
53+
54+
due_date = match.group(1)
55+
56+
credentials_info = json.loads(os.environ["GCAL_CREDENTIALS_JSON"])
57+
creds = service_account.Credentials.from_service_account_info(
58+
credentials_info,
59+
scopes=["https://www.googleapis.com/auth/calendar"]
60+
)
61+
62+
service = build("calendar", "v3", credentials=creds)
63+
calendar_id = credentials_info.get("calendar_id", "primary")
64+
65+
event = {
66+
"summary": f"Issue: {title}",
67+
"description": f"{url}",
68+
"start": {"date": due_date},
69+
"end": {"date": due_date},
70+
}
71+
72+
created_event = service.events().insert(calendarId=calendar_id, body=event).execute()
73+
print(f"Event created: {created_event.get('htmlLink')}")

.github/workflows/temp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# .env.*
2-
/node_modules
2+
/node_modules
3+
4+
.DS_Store
File renamed without changes.

0 commit comments

Comments
 (0)