Skip to content

ci: fix lint, bump and pin actions, add dependabot - #818

Merged
giuseppe merged 8 commits into
opencontainers:masterfrom
kolyshkin:ci-update
Oct 16, 2026
Merged

giuseppe merged 8 commits into
opencontainers:masterfrom
kolyshkin:ci-update

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The lint job is failing since setup-go's stable moved to Go 1.27, as golangci-lint v2.9 (built with go1.26) can't load packages compiled by a newer Go.

This:

  1. Fixes the four issues reported by a newer golangci-lint (the first commit from ci: update golangci-lint for compatibility with go1.27 #815, by @dangowrt).
  2. Switches golangci-lint from a pinned version to latest. Since the lint job uses the latest stable Go anyway, this avoids bumping the pin on every Go release, and makes a new Go release result in new warnings rather than in a non-working linter.
  3. Bumps actions/checkout to v7.0.1 and actions/setup-go to v7.0.0, pinning them by commit SHA.
  4. Switches CI runners to ubuntu-26.04.
  5. Replaces the third-party tim-actions/get-pr-commits and tim-actions/commit-message-checker-with-regex with a few lines of shell using the GitHub API (same as in opencontainers/runc@23b509a).
  6. Bumps golangci/golangci-lint-action to v9.3.0, pinning it by commit SHA.
  7. Fixes issues reported by zizmor: sets persist-credentials: false for actions/checkout, read-only default workflow permissions, and disables actions/setup-go caching.
  8. Adds a dependabot config (with a 7-day cooldown) to keep GitHub Actions up to date.

Closes: #815

dangowrt and others added 2 commits October 14, 2026 16:03
A golangci-lint built against Go 1.27 reports four issues on the tree
that the currently pinned version never reaches, because it aborts on a
typecheck error before any linter runs.

Two are govet telling us reflect.Ptr is the old spelling of
reflect.Pointer. Two are staticcheck on the deprecated Hooks.Prestart in
a test table, annotated the way the non-test use of the same field in
checkEventHooks already is.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The lint job fails since setup-go's "stable" became Go 1.27, as
golangci-lint v2.9 is built with go1.26 and can't load packages
compiled by a newer Go:

    could not load export data ... export data version 4 is greater
    than maximum supported version 2

Since the lint job uses the latest stable Go, it makes sense to also
use the latest golangci-lint, rather than pinning it and bumping the
pin every time a new Go release comes out. This way, a new Go release
results in new warnings (which we need to fix anyway) rather than in
golangci-lint being unable to work at all.

The issues found by the current version (v2.14.0) were fixed by the
previous commit.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin
kolyshkin requested a review from a team as a code owner October 14, 2026 23:08
@kolyshkin

Copy link
Copy Markdown
Contributor Author

2. Switches golangci-lint from a pinned version to latest.

The alternative to that is to switch back from stable to a specified go version -- and in that case we'll need to update both go and golangci-lint version every 6 months (which is a burden).

thaJeztah
thaJeztah previously approved these changes Oct 14, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread .github/workflows/test.yml Outdated
thaJeztah
thaJeztah previously approved these changes Oct 15, 2026

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread .github/workflows/test.yml Outdated
Bump actions/checkout to v7.0.1 and actions/setup-go to v7.0.0,
pinning them by commit SHA.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Replace two third-party actions (tim-actions/get-pr-commits and
tim-actions/commit-message-checker-with-regex) with a few lines of shell
using the GitHub API.

Listing the PR commits via the API means no checkout is needed. Merge
commits are skipped, as their subjects are generated by git and GitHub,
not by the contributor.

The API output is saved to a file before being fed to jq, rather than
piped into it. In a pipeline, a gh failure would be masked, as jq
happily succeeds on empty input. With the file, a gh failure fails the
step via the default bash -e.

While at it, set explicit minimal permissions for the job.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Bump golangci/golangci-lint-action to v9.3.0 and pin it by commit SHA,
like actions/checkout and actions/setup-go already are.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin changed the title ci: fix lint, bump actions, add dependabot ci: fix lint, bump and pin actions, add dependabot Oct 16, 2026
@kolyshkin
kolyshkin requested a review from thaJeztah October 16, 2026 08:51
Fix the following issues reported by zizmor:

 - artipacked: set persist-credentials: false for actions/checkout,
   as no job needs git credentials after checkout;
 - excessive-permissions: set read-only default permissions for the
   workflow (the commit job sets its own);
 - cache-poisoning: disable actions/setup-go caching. The Go module
   cache is of little use here since dependencies are vendored.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This makes dependabot open PRs to bump actions used by CI workflows,
so they don't get stale.

Use a 7-day cooldown, so a new release gets some time in the wild
(and a chance to be yanked if compromised) before we pick it up.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin

Copy link
Copy Markdown
Contributor Author

just wanted to make CI green again and look what we have here now...

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe
giuseppe merged commit ffb3fe5 into opencontainers:master Oct 16, 2026
9 checks passed
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.

5 participants