feat: add GitHub Actions workflow linters#332
feat: add GitHub Actions workflow linters#332k8s-ci-robot merged 3 commits intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
Welcome @Aliexe-code! |
|
Hi @Aliexe-code. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
@Aliexe-code To fix the "The list of commits with invalid commit messages" error, you'll need to remove |
.github/workflows/ci.yml
Outdated
| go-version-file: go.mod | ||
|
|
||
| - name: Run Unit Tests | ||
| run: ./dev/ci/presubmits/test-unit |
There was a problem hiding this comment.
All the presubmit tests in CI are running on prow, instead of being handled by GitHub Actions. Currently, all changes to .github/workflows are skipped in prow, ref kubernetes/test-infra#36482
Suggest using GitHub Action to trigger validation only on .github/workflows changes.
https://github.com/marketplace/actions/rhysd-actionlint might be a good tool to use here.
You'll only need to modify .github/workflows in this PR, and won't need to modify dev/ and Makefile.
9802070 to
56331d2
Compare
|
@Aliexe-code: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
- Add CI workflow using rhysd/actionlint to validate workflow files - Triggers only on changes to .github/workflows/**
|
The test failure comes from this known flake: #326 |
56331d2 to
c420ee1
Compare
.github/workflows/ci.yml
Outdated
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Run actionlint | ||
| uses: rhysd/actionlint@v1 |
There was a problem hiding this comment.
We should use devops-actions/actionlint@v0.1.10 wrapper from the Marketplace, to make using it easier. Please take a look at the user guide: https://github.com/marketplace/actions/rhysd-actionlint
.github/workflows/ci.yml
Outdated
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write |
There was a problem hiding this comment.
For safety, let's keep the permission read-only (remove L12-14). We should be able to see error logs in the job runs, so we don't need to grant it permission to modify PRs. This change lgtm after this is fixed.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Aliexe-code, janetkuo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
Fixes #327
Adds GitHub Actions workflow validation using
actionlintto catch errors before merging.Changes
actionlinttool to validate workflow YAML filesdev/tools/lint-workflowsscriptdev/ci/presubmits/lint-workflowspresubmit check.github/workflows/ci.ymlto run lint and tests on PRsmake lint-workflowstarget