Skip to content

Commit 3ffe91f

Browse files
chore: reuse GitHub hygiene workflows (#176)
* chore(ci): convert to reusable GHA workflows via sovereign * fix(release): declare "license": "MIT" in package.json * fix(deps): upgrade vite to ^7.3.5 (HIGH CVEs) * fix(deps): override tmp security advisory * ci: limit reusable workflow permissions --------- Co-authored-by: saagpatel <41898282+saagpatel@users.noreply.github.com>
1 parent 6841416 commit 3ffe91f

5 files changed

Lines changed: 5682 additions & 2978 deletions

File tree

.github/workflows/git-hygiene.yml

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,11 @@ name: git-hygiene
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, edited]
6-
branches: [master]
6+
branches: [main, master]
77

88
jobs:
9-
commitlint:
10-
runs-on: ubuntu-latest
9+
git-hygiene:
10+
uses: saagpatel/sovereign/.github/workflows/git-hygiene.yml@main
1111
permissions:
1212
contents: read
13-
steps:
14-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
15-
with:
16-
fetch-depth: 0
17-
- uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed
18-
19-
pr-title:
20-
runs-on: ubuntu-latest
21-
permissions:
22-
pull-requests: read
23-
steps:
24-
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50
25-
env:
26-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
28-
branch-name:
29-
runs-on: ubuntu-latest
30-
permissions:
3113
pull-requests: read
32-
steps:
33-
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
34-
with:
35-
script: |
36-
const branch = context.payload.pull_request?.head?.ref || "";
37-
const pattern = /^codex\/(feat|fix|chore|refactor|docs|test|perf|ci|spike|hotfix)\/[a-z0-9]+(?:-[a-z0-9]+)*$/;
38-
const releasePleasePattern = /^release-please--branches--.+--components--[a-z0-9]+(?:-[a-z0-9]+)*$/;
39-
const dependabotPattern = /^dependabot\/.+/;
40-
if (releasePleasePattern.test(branch)) {
41-
core.info(`Release Please automation branch detected: ${branch}`);
42-
return;
43-
}
44-
if (dependabotPattern.test(branch)) {
45-
core.info(`Dependabot automation branch detected: ${branch}`);
46-
return;
47-
}
48-
if (!pattern.test(branch)) {
49-
core.setFailed(`Invalid branch name: ${branch}`);
50-
}
51-
52-
secrets:
53-
runs-on: ubuntu-latest
54-
permissions:
55-
contents: read
56-
steps:
57-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
58-
with:
59-
fetch-depth: 0
60-
- uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lockfile-rationale.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,10 @@ name: lockfile-rationale
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, edited]
6-
branches: [master]
7-
8-
permissions:
9-
contents: read
10-
pull-requests: read
116

127
jobs:
13-
enforce:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
17-
- uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c
18-
id: changed
19-
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
20-
if: contains(steps.changed.outputs.all_changed_files, 'pnpm-lock.yaml') || contains(steps.changed.outputs.all_changed_files, 'package-lock.json') || contains(steps.changed.outputs.all_changed_files, 'yarn.lock')
21-
with:
22-
script: |
23-
const body = context.payload.pull_request.body || "";
24-
const author = context.payload.pull_request.user?.login || "";
25-
const title = context.payload.pull_request.title || "";
26-
const dependabotAuthors = new Set(["app/dependabot", "dependabot[bot]", "dependabot"]);
27-
const isDependabotBump =
28-
dependabotAuthors.has(author) && /^build\(deps\): bump /i.test(title);
29-
if (isDependabotBump || (dependabotAuthors.has(author) && /updated-dependencies:/i.test(body))) {
30-
core.info("Dependabot dependency bump accepted as lockfile rationale.");
31-
return;
32-
}
33-
if (!/## Lockfile rationale/i.test(body)) {
34-
core.setFailed("Lockfile changed but PR body lacks 'Lockfile rationale' section.");
35-
}
8+
lockfile-rationale:
9+
uses: saagpatel/sovereign/.github/workflows/lockfile-rationale.yml@main
10+
permissions:
11+
contents: read
12+
pull-requests: read

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "assistsupport",
33
"private": true,
4+
"license": "MIT",
45
"version": "1.3.0",
56
"type": "module",
67
"scripts": {
@@ -132,7 +133,7 @@
132133
"stylelint-config-standard": "^39.0.1",
133134
"typescript": "~5.8.3",
134135
"typescript-eslint": "^8.59.2",
135-
"vite": "^7.3.3",
136+
"vite": "^7.3.5",
136137
"vitest": "^4.1.8",
137138
"web-vitals": "^5.2.0"
138139
}

0 commit comments

Comments
 (0)