Skip to content

Commit 2328584

Browse files
ci: add OSS automation workflows and CODEOWNERS
- Add stale.yml to auto-close inactive issues/PRs - Add scorecard.yml for OpenSSF security health checks - Add labeler.yml to auto-label PRs by file paths - Add CODEOWNERS for auto-review assignment - Add all-contributors config for contributor recognition Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
1 parent a563ed7 commit 2328584

6 files changed

Lines changed: 181 additions & 0 deletions

File tree

.all-contributorsrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"projectName": "JEngine",
3+
"projectOwner": "JasonXuDeveloper",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": ["README.md"],
7+
"imageSize": 100,
8+
"commit": true,
9+
"commitConvention": "angular",
10+
"contributors": [],
11+
"contributorsPerLine": 7,
12+
"skipCi": true,
13+
"contributorsSortAlphabetically": false
14+
}

.github/CODEOWNERS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CODEOWNERS - Auto-assign reviewers for pull requests
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
# Default owner for everything
5+
* @JasonXuDeveloper
6+
7+
# Core package
8+
/UnityProject/Packages/com.jasonxudeveloper.jengine.core/ @JasonXuDeveloper
9+
10+
# Util package
11+
/UnityProject/Packages/com.jasonxudeveloper.jengine.util/ @JasonXuDeveloper
12+
13+
# CI/CD workflows
14+
/.github/workflows/ @JasonXuDeveloper
15+
16+
# Documentation
17+
/*.md @JasonXuDeveloper
18+
/docs/ @JasonXuDeveloper

.github/labeler.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Auto-labeler configuration
2+
# https://github.com/actions/labeler
3+
4+
# Core package changes
5+
core:
6+
- changed-files:
7+
- any-glob-to-any-file: 'UnityProject/Packages/com.jasonxudeveloper.jengine.core/**'
8+
9+
# Util package changes
10+
util:
11+
- changed-files:
12+
- any-glob-to-any-file: 'UnityProject/Packages/com.jasonxudeveloper.jengine.util/**'
13+
14+
# CI/CD changes
15+
ci:
16+
- changed-files:
17+
- any-glob-to-any-file: '.github/workflows/**'
18+
- any-glob-to-any-file: '.github/*.yml'
19+
20+
# Documentation changes
21+
documentation:
22+
- changed-files:
23+
- any-glob-to-any-file: '**/*.md'
24+
- any-glob-to-any-file: 'docs/**'
25+
26+
# Test changes
27+
tests:
28+
- changed-files:
29+
- any-glob-to-any-file: 'UnityProject/Assets/Tests/**'
30+
- any-glob-to-any-file: '**/*Tests*/**'
31+
- any-glob-to-any-file: '**/*.Tests.cs'
32+
33+
# Editor code changes
34+
editor:
35+
- changed-files:
36+
- any-glob-to-any-file: '**/Editor/**'
37+
38+
# Sample/demo changes
39+
samples:
40+
- changed-files:
41+
- any-glob-to-any-file: 'UnityProject/Assets/Samples/**'
42+
- any-glob-to-any-file: '**/Samples~/**'

.github/workflows/labeler.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Auto Labeler
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Apply labels based on changed files
16+
uses: actions/labeler@v5
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
configuration-path: .github/labeler.yml
20+
sync-labels: true

.github/workflows/scorecard.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
# Run on pushes to master and weekly
5+
push:
6+
branches: [master]
7+
schedule:
8+
# Run every Monday at 00:00 UTC
9+
- cron: '0 0 * * 1'
10+
workflow_dispatch:
11+
12+
permissions: read-all
13+
14+
jobs:
15+
analysis:
16+
name: Scorecard Analysis
17+
runs-on: ubuntu-latest
18+
permissions:
19+
security-events: write # Upload to Security tab
20+
id-token: write # Publish results
21+
actions: read
22+
contents: read
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- name: Run Scorecard analysis
31+
uses: ossf/scorecard-action@v2.4.0
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
publish_results: true
36+
37+
- name: Upload to Security tab
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: results.sarif

.github/workflows/stale.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Stale Issues and PRs
2+
3+
on:
4+
schedule:
5+
# Run daily at midnight 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+
steps:
17+
- name: Mark stale issues and PRs
18+
uses: actions/stale@v9
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
# Issue settings
23+
stale-issue-message: |
24+
This issue has been automatically marked as stale because it has not had recent activity.
25+
It will be closed in 14 days if no further activity occurs.
26+
If this issue is still relevant, please comment or remove the stale label.
27+
stale-issue-label: 'stale'
28+
days-before-issue-stale: 60
29+
days-before-issue-close: 14
30+
exempt-issue-labels: 'pinned,security,bug,enhancement,help wanted,good first issue'
31+
32+
# PR settings
33+
stale-pr-message: |
34+
This pull request has been automatically marked as stale because it has not had recent activity.
35+
It will be closed in 14 days if no further activity occurs.
36+
If this PR is still relevant, please comment, push changes, or remove the stale label.
37+
stale-pr-label: 'stale'
38+
days-before-pr-stale: 30
39+
days-before-pr-close: 14
40+
exempt-pr-labels: 'pinned,security,work-in-progress'
41+
42+
# Close message
43+
close-issue-message: 'This issue was closed due to inactivity. Feel free to reopen if still relevant.'
44+
close-pr-message: 'This PR was closed due to inactivity. Feel free to reopen if still relevant.'
45+
46+
# Operations per run (to avoid rate limiting)
47+
operations-per-run: 100

0 commit comments

Comments
 (0)