ci: add actionlint - #5385
Conversation
|
Wondering how this one compares to Zimor (which has proven to be very good overall); https://github.com/zizmorcore/zizmor cc @crazy-max |
IMHO actionlint is more about correctness, while zizmor is more about security. Perhaps we can use both? |
|
Alas actionlint is a bit abandoned with no commits since mid-April, and it lacks last versions of standard actions (and thus it doesn't flag some issues). Opened rhysd/actionlint#718 as a fix. |
Maybe, yes. I'm honestly not that familiar with actionlint. We should look where they overlap, and where gaps are (ISTR zizmor also had various checks for correctness, so maybe already covers a bunch). |
I ran a quick test (with the help of AI): actionlint caught 6 of 7 issues, zizmor only found 1 of 7. NOTE this test is deliberately biased towards broken workflows (rather than their security). Here's the file: name: broken
on:
pull_request:
permissions:
contents: read
jobs:
j:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- run: echo ${{ github.event.pull_request.title }} # 1
- run: echo "${{ matrix.nosuch }}" # 2
- if: github.event_name == 'pull_request' && sucess() # 3
run: |
FILES=$(ls)
echo $FILES # 4
- uses: actions/setup-go@v7
with:
go-versionn: '1.24' # 5
k:
needs: nonexistent # 6
runs-on: ubunut-24.04 # 7
steps:
- run: trueIssues:
Zizmor only found 1 ("template-injection"). actionlint found all but 5 (and this is being fixed in rhysd/actionlint#718). I am not against adding zizmor (and will probably do so later), but it serves a very different purpose to that of actionlint. |
Done: #5387 |
|
Again, zizmor and actionlint serve entirely different purposes:
|
|
I was working on adding actionlint and zizmor to libpathrs and I also found that they have totally different uses and having both is useful -- it is really nice when actionlint finds a typo in a variable substitution without you need to do a full CI run to find it. |
| VERSION: 1.7.12 | ||
| BASEURL: https://github.com/rhysd/actionlint/releases/download | ||
| SHA256: c872d6db8c6bf83a8eaa704fc93999f027d55dffbc63b8a6abdccb47df5f4cd4 |
There was a problem hiding this comment.
There isn't an action we can pin against? If we do it this way dependabot won't be able to bump this for us (FWIW renovate has mechanisms to allow for custom bump rules that would work here but we decided to not switch last time we discussed this IIRC).
There was a problem hiding this comment.
There's a third party action which we can use. Internally it runs a docker image and has a few small issues () but I guess the luxury of being updated by dependabot outweighs the flaws.
Changed to use https://github.com/devops-actions/actionlint
There was a problem hiding this comment.
For the reference, the "few small issues" with actionlint action are:
There was a problem hiding this comment.
(those do not prevent from using the action as is, IOW we don't have to wait for a new version with those PRs applied)
ebd055b to
2b10966
Compare
This is mostly shellcheck complaining about missing quotes (SC2046 and SC2086). Issues found by actionlint (which runs shellcheck for all run: statements in GHA workflows. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Debugging GHA yaml is not fun -- usually when there is an issue with a workflow file, it just doesn't run. Let's add a separate actionlint job to catch workflow issues. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2b10966 to
614303b
Compare
|
@opencontainers/runc-maintainers PTAL (easy to review, CI only, and I have another PR which depending on this one) |
No description provided.