Skip to content

Commit 2c6d718

Browse files
committed
chore: add new workflows, issue & pr templates
1 parent a9d6e5c commit 2c6d718

9 files changed

Lines changed: 238 additions & 27 deletions

File tree

.github/FUNDING.yml

Whitespace-only changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug or unexpected behavior
4+
labels: ["bug"]
5+
assignees: []
6+
---
7+
8+
## Bug Description
9+
10+
Please describe the bug you encountered in as much detail as possible.
11+
12+
- What happened?
13+
- What did you expect to happen?
14+
- Are there any error messages shown?
15+
16+
## Steps to Reproduce
17+
18+
1.
19+
2.
20+
3.
21+
4.
22+
23+
_(Please include exact steps so we can reproduce the issue.)_
24+
25+
## Screenshots / Logs
26+
27+
If applicable, add screenshots or logs to help explain your problem.
28+
29+
## Environment
30+
31+
| Feature | Details |
32+
|---------|---------|
33+
| OS | |
34+
| Datary Version | |
35+
| Database | |
36+
37+
## Additional Context
38+
39+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Support & Community
4+
url: https://github.com/teacoder52/datary/discussions
5+
about: Join our community if you have questions or general discussions.
6+
7+
- name: Security Report
8+
url: https://github.com/teacoder52/datary/security/advisories
9+
about: Report security issues privately using GitHub Security Advisories.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new idea or improvement
4+
labels: ["enhancement"]
5+
assignees: []
6+
---
7+
8+
## Feature Description
9+
10+
What feature are you requesting?
11+
Please explain why this would be useful and who would benefit from it.
12+
13+
## Use Case / Motivation
14+
15+
- What problem does this solve?
16+
- How is it useful?
17+
18+
## Suggested Implementation
19+
20+
If you have ideas about how this could work (UI, behavior, API), describe them here.
21+
22+
## Examples / References
23+
24+
If this idea exists in other tools or contexts, include links, screenshots, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Description
2+
3+
<!-- Please describe what this PR does. Explain the problem it solves or the feature it adds. -->
4+
5+
## Checklist
6+
7+
- [ ] My code follows the style guidelines of this project
8+
- [ ] I have performed a self-review of my own code
9+
- [ ] I have updated the documentation if necessary
10+
- [ ] All new and existing tests passed
11+
- [ ] PR is ready for review
12+
13+
## Issues related (if applicable)
14+
15+
<!-- Link related issues here -->
16+
17+
Closes #123
18+
19+
## Screenshots (if applicable)
20+
21+
<!-- Add screenshots or GIFs if your change affects UI -->

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
env:
14+
NODE_VERSION: 20
15+
PNPM_VERSION: 10.0.0
16+
CI: true
17+
18+
jobs:
19+
setup:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ env.NODE_VERSION }}
28+
29+
- name: Setup pnpm
30+
- uses: pnpm/action-setup@v4
31+
with:
32+
version: ${{ env.PNPM_VERSION }}
33+
34+
- name: Install dependencies
35+
- run: pnpm install --frozen-lockfile
36+
37+
format-check:
38+
runs-on: ubuntu-latest
39+
needs: setup
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Prettier check
44+
run: pnpm run prettier:check

.github/workflows/codeql.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CodeQL Analysis
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze code
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Initialize CodeQL
17+
uses: github/codeql-action/init@v2
18+
with:
19+
languages: javascript, typescript
20+
21+
- name: Autobuild
22+
uses: github/codeql-action/autobuild@v2
23+
24+
- name: Perform CodeQL Analysis
25+
uses: github/codeql-action/analyze@v2

.github/workflows/notify.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Notify
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
types: [opened, closed, reopened, merged]
10+
issues:
11+
types: [opened, closed, reopened]
12+
13+
env:
14+
NODE_VERSION: 20
15+
16+
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
17+
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
18+
19+
GITHUB_ACTOR: ${{ github.actor }}
20+
GITHUB_EVENT_NAME: ${{ github.event_name }}
21+
GITHUB_REPOSITORY: ${{ github.repository }}
22+
GITHUB_REF: ${{ github.ref }}
23+
GITHUB_SHA: ${{ github.sha }}
24+
25+
jobs:
26+
telegram-notify:
27+
name: Telegram Notification
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: ${{ env.NODE_VERSION }}
38+
39+
- name: Install dependencies
40+
run: npm install node-fetch
41+
42+
- name: Send Telegram notification
43+
run: |
44+
node -e "
45+
import fetch from 'node-fetch';
46+
47+
const token = process.env.TELEGRAM_BOT_TOKEN;
48+
const chatId = process.env.TELEGRAM_CHAT_ID;
49+
const actor = process.env.GITHUB_ACTOR;
50+
const event = process.env.GITHUB_EVENT_NAME;
51+
const repo = process.env.GITHUB_REPOSITORY;
52+
const ref = process.env.GITHUB_REF;
53+
const sha = process.env.GITHUB_SHA;
54+
55+
let message = `*GitHub Notification*\nRepository: ${repo}\nActor: ${actor}\nEvent: ${event}\nRef: ${ref}\nSHA: ${sha}`;
56+
57+
if (event === 'pull_request') {
58+
const pr = JSON.parse(process.env.GITHUB_EVENT_PATH);
59+
message += `\nPR Title: ${pr.pull_request.title}\nAction: ${pr.action}\nURL: ${pr.pull_request.html_url}`;
60+
}
61+
62+
if (event === 'issues') {
63+
const issue = JSON.parse(process.env.GITHUB_EVENT_PATH);
64+
message += `\nIssue Title: ${issue.issue.title}\nAction: ${issue.action}\nURL: ${issue.issue.html_url}`;
65+
}
66+
67+
fetch(`https://api.telegram.org/bot${token}/sendMessage`, {
68+
method: 'POST',
69+
headers: { 'Content-Type': 'application/json' },
70+
body: JSON.stringify({
71+
chat_id: chatId,
72+
text: message,
73+
parse_mode: 'Markdown'
74+
})
75+
});
76+
"

.github/workflows/release.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,6 @@ jobs:
6464
exit 1
6565
fi
6666
67-
quality-gate:
68-
name: Quality Gate
69-
runs-on: ubuntu-latest
70-
needs: preflight
71-
timeout-minutes: 20
72-
73-
steps:
74-
- uses: actions/checkout@v4
75-
76-
- name: Setup pnpm
77-
uses: pnpm/action-setup@v4
78-
with:
79-
version: ${{ env.PNPM_VERSION }}
80-
run_install: false
81-
82-
- name: Setup Node.js
83-
uses: actions/setup-node@v4
84-
with:
85-
node-version: ${{ env.NODE_VERSION }}
86-
cache: pnpm
87-
88-
- name: Install deps
89-
run: pnpm install --frozen-lockfile --prefer-offline
90-
91-
- name: Prettier check
92-
run: pnpm run prettier:check
93-
9467
build-windows:
9568
name: Build Windows & Create Release
9669
runs-on: windows-latest

0 commit comments

Comments
 (0)