Skip to content

[1.5] ci: replace some third-party actions - #5471

Open
kolyshkin wants to merge 2 commits into
opencontainers:release-1.5from
kolyshkin:1.5-5384
Open

kolyshkin wants to merge 2 commits into
opencontainers:release-1.5from
kolyshkin:1.5-5384

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

Backport of #5384 to release-1.5. Original description follows.


Two independent cleanups in the validate workflow, each replacing a
third-party action with a few lines in-tree.

1. commit job: simplify the subject length check

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 (based off of moby/moby#53327, thanks @thaJeztah!).
No checkout is needed at all, so no source reaches the runner.

Verified on this PR: the job concludes success in 3 steps and ~3s (down
from 5 steps and 4s with a shallow checkout), and a temporary commit with a
100-character subject was flagged (and only that one), exiting 1.

2. shellcheck job: drop lumaxis/shellcheck-problem-matchers

That action does nothing but ship a JSON file and echo an ::add-matcher::
command, so we now do that ourselves, with the matcher in
.github/shellcheck-tty.json.

Its matcher was also only annotating warning and error findings, for two
reasons: its severity capture group lists (note|warning|error), while
shellcheck severities are error, warning, info and style; and the
runner honors only error, warning and notice, silently skipping any
other match (Runner.Worker/Handlers/OutputManager.cs). As info and
style are the bulk of what shellcheck reports, most findings were never
annotated. Ours uses a fixed severity instead (any finding fails the job
anyway) and keeps the severity word in the message.

Verified on a fork PR, on a file with four shellcheck problems (one info,
one style, two warning):

  • no matcher at all: no annotations, just the generic "Process completed with
    exit code 2";
  • upstream matcher: 2 of 4 annotated;
  • this one: all 4, at the right file and line.

Note that the usual gcc-format matchers have the same problem, as shellcheck -f gcc reports both info and style as note, which is not notice.

kolyshkin and others added 2 commits September 14, 2026 12:17
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 at all,
so the job takes a couple of seconds. 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.

The if is kept at the step level rather than the job level, so that the
job still succeeds (with its step skipped) for non-PR events. A skipped
job would cascade and skip all-done.

(cherry picked from commit 23b509a)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The lumaxis/shellcheck-problem-matchers action merely ships a JSON file
and echoes an ::add-matcher:: command, so do that ourselves.

Its matcher only annotated warning and error findings. Two reasons: the
severity capture group listed (note|warning|error), while shellcheck
severities are error, warning, info and style; and the runner honors
only error, warning and notice, skipping any other match (see
Runner.Worker/Handlers/OutputManager.cs). As info and style are the bulk
of what shellcheck reports, most findings were never annotated. Use a
fixed severity instead (any finding fails the job anyway), and keep the
severity word as part of the message.

Note the same applies to the usual gcc-format matchers, as shellcheck
-f gcc reports both info and style as "note", which is not "notice".

Verified on a test PR: with no matcher, a file with four shellcheck
problems produces no annotations at all; with this one, all four are
annotated at the right lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 5b10527)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added the backport/1.5-pr A backport PR to release-1.5 label Sep 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci backport/1.5-pr A backport PR to release-1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants