Skip to content

ci: harden the workflows and use the organization's shared CI - #10

Merged
Jertlok merged 3 commits into
taimen-bringupfrom
ci/harden-workflows
Sep 16, 2026
Merged

Jertlok merged 3 commits into
taimen-bringupfrom
ci/harden-workflows

Conversation

@Jertlok

@Jertlok Jertlok commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What and why

change practice it follows
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}, cancel-in-progress only for pull requests Home Assistant core and astral-sh/uv use the same group. The old group (ci-<ref>, always cancelling) let a second push to main cancel the first push's run: tap run 35024225791 shows it happening.
timeout-minutes on every job GitHub's default is 360 minutes; rust-lang/rust and Home Assistant set explicit timeouts. Sized a few times the measured job duration.
merge_group trigger (CI and Build; a merge group builds what its pull requests change) Required for a merge queue (GitHub docs).
Commit check from porthole-dev/.github/actions/commit-check, pinned by commit One copy instead of six byte-identical ones. It fetches the whole commit history with --filter=tree:0, so a base older than the former fetch-depth: 100 fails loudly instead of reporting "no new commits". Check name stays Commit check.
base-commit.sh fails when the base it should print is outside the fetch-depth: 100 checkout It printed nothing, and lint and the patch check then checked no aport and passed. New test-base-commit.sh runs in the lint job (and fails against the old script).
patch check: actions/cache/restore always, actions/cache/save only on push A pull request's cache is readable only by that pull request; saving one per pull request run evicts the useful ones from the 10 GB repository limit. The Build job's caches are left as they are (the build speed work owns them).
Workflow lint job: actionlint + zizmor uv runs zizmor on every pull request (check-zizmor.yml); both tools are what the OpenSSF Scorecard and GitHub's security hardening guide checks are about (pinning, token permissions, injection).
CI passed (CI) and Build passed (Build) aggregate jobs; the matrix jobs are named Build (<package>), so nothing else is requirable uv's "all required jobs passed": one required check, so adding or renaming a job never needs a ruleset change, and a failed or cancelled job cannot be skipped past.
.github/dependabot.yml: GitHub Actions weekly, grouped, 7-day cooldown Scorecard "Pinned-Dependencies" expects SHA pins to be kept current; the cooldown is zizmor's dependabot-cooldown recommendation. Dependabot commits need the maintainer's sign-off before merge like any other.
persist-credentials: false, least-privilege permissions zizmor artipacked / excessive-permissions.

Stacked on #9

The first commit is #9's (the publish fix); review the last commit here, and merge #9 first.

Depends on

  1. ci: add shared commit check, workflow lint and app release .github#2 merged.
  2. While porthole-dev/.github is private: its Settings > Actions > General > Access set to "Accessible from repositories in the porthole-dev organization". Until then Commit check, Workflow lint and CI passed fail with "Unable to resolve action porthole-dev/.github, repository not found".
  3. The pins (@43919fe... # main) moved to the merged commit and its tag (# v1.0.0); zizmor's ref-version-mismatch warns until the comment names a tag.

Merge note

The Commit check fails until the commit carries the maintainer's Signed-off-by (git rebase --signoff taimen-bringup).

@Jertlok
Jertlok force-pushed the ci/harden-workflows branch 3 times, most recently from adbfa77 to dbcf869 Compare September 16, 2026 06:37
- Concurrency per pull request in CI, cancelling only superseded pull
  request runs; a second push to taimen-bringup no longer cancels the
  first push's checks.
- merge_group in CI and Build, so a merge queue can run them; a merge
  group builds what its pull requests change.
- Timeouts on the jobs that had none; the upstream check runs one at a
  time.
- The commit check is porthole-dev/.github's commit-check action instead
  of a copy of its scripts. base-commit.sh stays for the aport jobs and
  now fails when the base it should print is outside the checkout: a push
  whose base lay beyond fetch-depth 100 printed nothing, and lint and the
  patch check then checked no aport and passed. It also knows merge
  groups, and has a test.
- The patch check restores the apk cache everywhere but saves it only on
  pushes, so pull requests stop filling the 10 GB cache with copies only
  they can read.
- Workflow lint (actionlint, zizmor), and "CI passed" and "Build passed"
  aggregate jobs: the two checks a ruleset needs to require, since the
  matrix build jobs are named after their packages.
- Dependabot keeps the pinned actions current, weekly and grouped, with a
  seven-day cooldown.

Assisted-by: Claude
Signed-off-by: Giuseppe Maggio <jertlok@proton.me>
"Select packages" failed on a pull request that deletes one file and adds
another: git diff tried to compare their contents for rename detection,
which downloads blobs the blob:none checkout does not have, with no
credentials to fetch them ("could not fetch ... from promisor remote").
forks() already turned rename detection off; changed() now does, for
every caller.

Assisted-by: Claude
Signed-off-by: Giuseppe Maggio <jertlok@proton.me>
The previous pin named a commit from the pull request branch, which the
rebase merge orphaned; an orphaned commit can be garbage-collected and the
action then stops resolving. Point at the commit main was tagged v1.0.0.

Assisted-by: Claude
Signed-off-by: Giuseppe Maggio <jertlok@proton.me>
@Jertlok
Jertlok force-pushed the ci/harden-workflows branch from dbcf869 to 82d872f Compare September 16, 2026 07:51
@Jertlok
Jertlok merged commit f57d129 into taimen-bringup Sep 16, 2026
7 of 9 checks passed
@Jertlok
Jertlok deleted the ci/harden-workflows branch September 16, 2026 07:52
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.

1 participant