Skip to content

Commit fb0f318

Browse files
authored
Merge pull request #77 from objectstack-ai/copilot/add-github-workflow
2 parents adaa69f + b518bfd commit fb0f318

File tree

8 files changed

+404
-0
lines changed

8 files changed

+404
-0
lines changed

.github/labeler.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Configuration for PR auto-labeling
2+
# Labels are applied based on file path patterns
3+
4+
'📦 dependencies':
5+
- changed-files:
6+
- any-glob-to-any-file: ['package.json', 'pnpm-lock.yaml', '**/package.json']
7+
8+
'📚 documentation':
9+
- changed-files:
10+
- any-glob-to-any-file: ['docs/**/*', '**/*.md', 'README.md']
11+
12+
'🔧 tooling':
13+
- changed-files:
14+
- any-glob-to-any-file: ['packages/tools/**/*', '.github/**/*', 'scripts/**/*']
15+
16+
'🏗️ foundation':
17+
- changed-files:
18+
- any-glob-to-any-file: ['packages/foundation/**/*']
19+
20+
'🔌 drivers':
21+
- changed-files:
22+
- any-glob-to-any-file: ['packages/drivers/**/*']
23+
24+
'🚀 runtime':
25+
- changed-files:
26+
- any-glob-to-any-file: ['packages/runtime/**/*']
27+
28+
'📝 examples':
29+
- changed-files:
30+
- any-glob-to-any-file: ['examples/**/*']
31+
32+
'⚡ starters':
33+
- changed-files:
34+
- any-glob-to-any-file: ['packages/starters/**/*']
35+
36+
'🧪 tests':
37+
- changed-files:
38+
- any-glob-to-any-file: ['**/*.test.ts', '**/*.spec.ts', '**/jest.config.js']
39+
40+
'🔒 security':
41+
- changed-files:
42+
- any-glob-to-any-file: ['**/*.permission.yml', '**/security/**/*']
43+
44+
'⚙️ configuration':
45+
- changed-files:
46+
- any-glob-to-any-file: ['tsconfig*.json', '.gitignore', '.npmrc', 'pnpm-workspace.yaml']

.github/workflows/codeql.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "CodeQL Security Scan"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
# Run every Monday at 00:00 UTC
10+
- cron: '0 0 * * 1'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze Code
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'javascript' ]
26+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Initialize CodeQL
33+
uses: github/codeql-action/init@v3
34+
with:
35+
languages: ${{ matrix.language }}
36+
# If you want to specify custom queries, add them here
37+
# queries: security-extended,security-and-quality
38+
39+
- name: Autobuild
40+
uses: github/codeql-action/autobuild@v3
41+
42+
- name: Perform CodeQL Analysis
43+
uses: github/codeql-action/analyze@v3
44+
with:
45+
category: "/language:${{matrix.language}}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Dependency Review"
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
dependency-review:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Dependency Review
20+
uses: actions/dependency-review-action@v4
21+
with:
22+
# Fail the action if vulnerabilities with severity >= moderate are detected
23+
fail-on-severity: moderate
24+
# Warn about deprecated packages
25+
warn-on-deprecated: true
26+
# Comment on the PR with the review results
27+
comment-summary-in-pr: on-failure

.github/workflows/labeler.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Pull Request Labeler"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
labeler:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Run Labeler
20+
uses: actions/labeler@v5
21+
with:
22+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
23+
configuration-path: .github/labeler.yml

.github/workflows/stale.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Stale Issue Management"
2+
3+
on:
4+
schedule:
5+
# Run every day at 00:00 UTC
6+
- cron: '0 0 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
stale:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
steps:
18+
- name: Mark/Close Stale Issues and PRs
19+
uses: actions/stale@v9
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
# Issues
24+
stale-issue-message: >
25+
This issue has been automatically marked as stale because it has not had
26+
recent activity. It will be closed in 14 days if no further activity occurs.
27+
Thank you for your contributions.
28+
close-issue-message: >
29+
This issue was automatically closed because it has not had activity for 74 days
30+
(marked stale after 60 days, then closed after 14 more days of inactivity).
31+
Please feel free to reopen if you believe this issue is still relevant.
32+
days-before-issue-stale: 60
33+
days-before-issue-close: 14
34+
stale-issue-label: 'stale'
35+
exempt-issue-labels: 'pinned,security,roadmap,help wanted'
36+
37+
# Pull Requests
38+
stale-pr-message: >
39+
This pull request has been automatically marked as stale because it has not had
40+
recent activity. It will be closed in 7 days if no further activity occurs.
41+
Please address any review comments or conflicts.
42+
close-pr-message: >
43+
This pull request was automatically closed because it has not had activity for 37 days
44+
(marked stale after 30 days, then closed after 7 more days of inactivity).
45+
Please feel free to reopen and address the review comments if you wish to continue.
46+
days-before-pr-stale: 30
47+
days-before-pr-close: 7
48+
stale-pr-label: 'stale'
49+
exempt-pr-labels: 'pinned,security,in progress'
50+
51+
# General settings
52+
operations-per-run: 100
53+
remove-stale-when-updated: true
54+
ascending: false

.github/workflows/typecheck.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Type Check
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
typecheck:
11+
name: TypeScript Type Check
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v3
19+
with:
20+
version: 10
21+
22+
- name: Use Node.js 20.x
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20.x
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
timeout-minutes: 5
31+
32+
- name: Run TypeScript type check
33+
run: |
34+
echo "Running TypeScript compiler in build mode for type checking..."
35+
pnpm tsc -b
36+
timeout-minutes: 5
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Validate Metadata Files
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- '**/*.object.yml'
8+
- '**/*.validation.yml'
9+
- '**/*.permission.yml'
10+
- '**/*.app.yml'
11+
- '**/*.page.yml'
12+
- '**/*.menu.yml'
13+
- 'scripts/validate-yaml.js'
14+
pull_request:
15+
branches: [ "main" ]
16+
paths:
17+
- '**/*.object.yml'
18+
- '**/*.validation.yml'
19+
- '**/*.permission.yml'
20+
- '**/*.app.yml'
21+
- '**/*.page.yml'
22+
- '**/*.menu.yml'
23+
- 'scripts/validate-yaml.js'
24+
25+
jobs:
26+
validate:
27+
name: Validate YAML Metadata
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 10
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: pnpm/action-setup@v3
35+
with:
36+
version: 10
37+
38+
- name: Use Node.js 20.x
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20.x
42+
cache: 'pnpm'
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
timeout-minutes: 5
47+
48+
- name: Validate YAML syntax
49+
run: |
50+
echo "Checking YAML syntax for metadata files..."
51+
pnpm exec node scripts/validate-yaml.js
52+
timeout-minutes: 5

0 commit comments

Comments
 (0)