Commit Graph
8 Commits
Author SHA1 Message Date
Lauri Ojansivu 7f7cc63cde GitHub Actions: no expressions in scripts, actions pinned, least privilege.
Qlty (zizmor) security findings in the workflows that build and publish
every release:

- template-injection (128): ${{ ... }} pasted into a run: script is expanded
  before the shell sees it, so a crafted workflow_dispatch input, tag or step
  output becomes shell code. 251 expressions in 13 workflows now reach their
  scripts through the step's env: and are used as quoted shell variables
  ($env:NAME in the PowerShell steps); ${{ env.X }} is plain $X. Where a
  value sat in single quotes it is double-quoted now, and six unquoted ones
  are quoted.
- unpinned-uses (20 in Qlty, 160 with current zizmor): every action is
  pinned to a commit, with its version as a comment for Dependabot.
  actions/dependency-review-action@v5 was a branch; it is v5.0.0.
- excessive-permissions (8): AppImage, Flatpak, mac, windows,
  release-all and release-all-missing grant contents: read at the workflow
  level, and each job that writes (a release asset, a git push, the docker
  push, gh run rerun) is granted that on the job. Nothing used actions:
  write except recover, which keeps it.
- artipacked (47 -> 13): actions/checkout gets persist-credentials: false,
  except in the jobs that push with the checkout's credentials, directly or
  through releases/version.sh, release-website.sh, release-charts.sh and
  backfill-charts.sh.

actionlint with shellcheck reports 50 notes, the 56 before minus the six
quoted. Every PowerShell step parses (pwsh 7.6.7). Not run on GitHub.

tests/workflowHardening.test.cjs fails on an expression in a run script,
an unpinned action, a workflow-level write grant in a multi-job workflow,
or a checkout keeping credentials outside the pushing jobs, and runs
zizmor when it is installed. Eleven guards that pinned the old text, or ran
the extracted scripts with the expressions substituted, now pin the env
form and pass the values as the step's environment.

Thanks to Qlty and xet7 !
2026-10-15 23:19:50 +03:00
Lauri Ojansivu ccff887734 Find release assets reliably before wrapping or building them.
Both v12.39 Mac apps were skipped although their bundles were attached:
`gh release view ... | grep -q` let grep exit at the first match while gh
was still writing, gh got SIGPIPE, pipefail failed the pipeline, and the
job said the bundle had not been published. The Windows EXE, Docker image
and snap-launchpad checks had the same shape. Each now reads the asset
list whole before matching it.

Thanks to xet7 !
2026-10-13 14:20:57 +03:00
Lauri Ojansivu 3c085a2d71 Fix Mac app smoke cleanup for exited process groups 2026-10-11 17:48:18 +03:00
Lauri Ojansivu 37bc66403f Attach each release file from the job that built it, also when cancelled.
Every job that builds a release file now attaches it to the GitHub Release
as its own last step, right after the build and its checks pass, through
releases/github-release-upload.sh (retried, bounded, verified by name and
size). Nothing waits for the other builds any more:

- build-amd64 creates the release (releases/ensure-github-release.sh) and
  attaches its zip; build-arm64 attaches its own. The release job no
  longer downloads and uploads them; it writes the notes and checks both
  base bundles and their .sha256sum are on the release.
- The win64, win-arm64, win32, mac-arm64, mac-x64, extra-arch, Sandstorm
  and snap jobs use the shared uploader.
- AppImage.yml, mac.yml and Flatpak.yml attach from each matrix build job
  instead of a final publish job; windows.yml attaches from its build job
  and its publish job is gone. release-all-missing.yml's extra-arches
  attach uses the shared uploader.

A cancelled run keeps what finished: every attach step runs on always()
plus its build step's success, and the final jobs (release notes, what is
still missing, the AppImage/Mac/Flatpak summaries and the Flatpak
repository) run on always() while still requiring the release to exist.

The uploader no longer needs GNU timeout, so it also runs on the macOS
runners and in Windows Git Bash.

Thanks to xet7 !
2026-10-04 17:10:53 +03:00
Lauri Ojansivu 6568268b24 Bound Mac app smoke-test shutdown for both architectures.
The app answered successfully but the EXIT trap waited forever after signaling only its launcher. Run the app in an isolated process group, terminate all descendants with bounded escalation, bound HTTP probes, and retain smoke logs. Cover successful startup, failed startup, stalled HTTP and TERM-resistant children on macOS.

Thanks to xet7 !
2026-09-24 18:40:28 +03:00
Lauri Ojansivu ba5ecaf14b Fix Mac archive checks and cross-platform release bundle failures.
List Mac app archives with unzip, handle shallow telemetry scanner paths, ship the Docker deny-hash policy, and discard inherited foreign ELF addons that shadow target prebuilds. Add offline regressions and a native macOS archive check.

Thanks to xet7 !
2026-09-24 14:02:30 +03:00
Lauri Ojansivu 19f740f509 Stabilize WeKan regression checks and macOS release jobs 2026-09-22 19:31:34 +03:00
Lauri Ojansivu b9ae16a443 Package separate macOS apps for Apple Silicon and Intel 2026-09-22 10:10:12 +03:00