Skip to content

Release workflow, Dependabot and CodeQL - #2

Open
ravimehra9911 wants to merge 2 commits into
mainfrom
claude/vigorous-yonath-2bcda7
Open

ravimehra9911 wants to merge 2 commits into
mainfrom
claude/vigorous-yonath-2bcda7

Conversation

@ravimehra9911

@ravimehra9911 ravimehra9911 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Moves desktop releases off the maintainer's laptop and adds basic supply-chain hygiene.

Release workflow (.github/workflows/release.yml)

  • Triggered by pushing a v* tag. Fails if the tag doesn't match electron/package.json's version.
  • Runs typecheck, lint and tests, then builds on macos-latest (arm64 + x64 dmg), windows-latest (exe) and ubuntu-latest (AppImage) with MAILCLEAN_BUNDLE_OAUTH=0, and checks build/config.json is {}.
  • scripts/check-release.mjs scans every unpacked app (including file names inside app.asar) for .env*, client_secret*, *.db/*.sqlite, encryption.key, .data/, *.pem/*.p12/*.pfx, a non-empty resources/config.json, and Google OAuth secrets, private keys, AWS keys and GitHub tokens. It prints the file and rule, never the value, and fails the job on a hit.
  • Uploads MailClean-mac-arm64.dmg, MailClean-mac-x64.dmg, MailClean-windows-x64.exe and MailClean-linux-x86_64.AppImage to a draft release. Re-runs replace files only while the release is still a draft. Publishing stays manual.
  • Optional, clearly marked macOS signing/notarization and Windows signing steps run only when MAC_CSC_LINK / WIN_CSC_LINK secrets exist.
  • PRs that touch packaging files (this one included) run the same build and scan, without creating a release.

Supply chain

  • .github/dependabot.yml: npm and github-actions, weekly, minor/patch grouped.
  • .github/workflows/codeql.yml: CodeQL for JavaScript/TypeScript (security-extended) on push, PR and weekly.
  • ci.yml: npm audit --audit-level=high. To make it pass: next 15.5.27 → 15.5.28, vitest 3 → 5, npm audit fix (electron, fast-uri), and an override pinning Next's nested postcss to ^8.5.30. Now 0 vulnerabilities; typecheck, lint, 37 tests and next build pass locally.

Docs

  • SECURITY.md (report to support@mailclean.app or a private advisory).
  • "Releasing" section in CONTRIBUTING.md (full tag flow) and README.md (short version).

Notes

  • actionlint wasn't available locally (no binary, Docker not running), so the workflows were only YAML-parsed locally; GitHub validates them on this PR.
  • The secret scan was run against the existing local dist-desktop build (clean) and against a folder with planted fakes (all 7 caught). The first version flagged OpenSSL's bare BEGIN PRIVATE KEY constant in libvips, so the rule now requires a key body.
  • No tags pushed, no release created.

Bump next to 15.5.28 and vitest to 5, apply npm audit fix (electron, fast-uri),
and override Next's nested postcss to ^8.5.30. npm audit --audit-level=high
now reports 0 vulnerabilities.
- release.yml: on v* tags, check the tag matches electron/package.json, run
  typecheck/lint/test, build the mac (arm64+x64), Windows and Linux installers
  on their own runners, scan the unpacked apps for secrets, and attach the four
  installers to a draft release. Optional signing/notarization steps run only
  when their secrets exist. PRs touching packaging run the build and scan.
- scripts/check-release.mjs: the secret scan (env files, OAuth client files,
  databases, encryption keys, non-empty resources/config.json, key strings).
- ci.yml: npm audit --audit-level=high.
- Dependabot (npm, github-actions; weekly, grouped minor/patch) and CodeQL.
- SECURITY.md and a Releasing section in CONTRIBUTING and README.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Comment thread scripts/check-release.mjs
if (!entry.isFile()) continue;
if (entry.name === "config.json" && /^resources$/i.test(path.basename(dir))) checkConfig(full, where);
if (fs.statSync(full).size > MAX_SCAN_BYTES) continue;
const buf = fs.readFileSync(full);
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mailclean Ready Ready Preview Oct 25, 2026 5:17am UTC

This branch was successfully deployed

1 active deployment
Preview — 03a36984 Deployed Oct 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants