Skip to content

Commit 753ea71

Browse files
authored
Merge pull request #12 from ohgodwhy2k/new-workflows
feat: New workflows
2 parents 13c80c8 + 87e3568 commit 753ea71

File tree

5 files changed

+2005
-60
lines changed

5 files changed

+2005
-60
lines changed

.github/workflows/bundle-size.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Bundle size check
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
workflow_dispatch:
10+
11+
jobs:
12+
bundle_size_check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Build project
18+
run: npm install && npm run build
19+
20+
- name: Report bundle size
21+
uses: preactjs/[email protected]
22+
with:
23+
# 1. The mandatory 'repo-token' is now provided
24+
repo-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
# 2. 'path' is replaced by 'pattern' for glob matching
27+
pattern: '**/*.{js,css}'
28+
29+
# Show the total size of all tracked files (useful)
30+
show-total: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Security Audit
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
# Allow manual trigger
11+
workflow_dispatch:
12+
13+
jobs:
14+
npm-audit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- name: Install dependencies
26+
# This step is critical for npm audit to work
27+
run: npm ci
28+
29+
- name: Run npm audit
30+
# The `--audit-level=high` flag only fails the check for HIGH or CRITICAL severity vulnerabilities
31+
# Remove the flag to check all levels, or change it to 'critical' to be less strict.
32+
run: npm audit --audit-level=high

.github/workflows/stale.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Close Stale Issues and PRs
2+
3+
on:
4+
schedule:
5+
# Run once a day at 10:30 UTC
6+
- cron: '30 10 * * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
stale:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- uses: actions/stale@v9
17+
with:
18+
# --- Consolidated Days Inputs (These are correct) ---
19+
days-before-stale: 30
20+
days-before-close: 7
21+
22+
# --- Explicit Label Inputs (Corrected for the error) ---
23+
stale-issue-label: 'stale'
24+
stale-pr-label: 'stale' # Use the same label for both issues and PRs
25+
26+
# --- Message Inputs ---
27+
stale-issue-message: 'This issue is stale because it has been open for 30 days without activity. It will be automatically closed in 7 days unless a comment is made or the stale label is removed.'
28+
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
29+
30+
stale-pr-message: 'This PR is stale because it has been open for 30 days without activity. It will be automatically closed in 7 days unless a comment is made or the stale label is removed.'
31+
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.'
32+
33+
# --- Exemption Inputs ---
34+
exempt-issue-labels: 'bug, enhancement, documentation'
35+
exempt-pr-labels: 'in progress'

0 commit comments

Comments
 (0)