Skip to content

Commit

Permalink
ci: migrate yamllint to GitHub Actions
Browse files Browse the repository at this point in the history
- Container image used in yaml-lint task is outdated and using it causes rate-limiting issues with docker.io
- Remove the task and create a GitHub Action that installs yamllint and then runs it
  • Loading branch information
tnevrlka committed Sep 23, 2024
1 parent c746a25 commit 2cb065a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 66 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/yaml-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: yamllint
on:

Check warning on line 3 in .github/workflows/yaml-lint.yaml

View workflow job for this annotation

GitHub Actions / yamllint

3:1 [truthy] truthy value should be one of [false, true]
pull_request:
branches: [main]
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install yamllint
run: pip install yamllint
- name: Lint YAML files
run: yamllint .
16 changes: 1 addition & 15 deletions .tekton/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ metadata:
name: build-definitions-pull-request
annotations:
pipelinesascode.tekton.dev/on-cel-expression: (event == "pull_request" && target_branch == "main" && ( !has(body.pull_request) || !body.pull_request.draft) ) || (event == "push" && target_branch.startsWith("gh-readonly-queue/main/"))
pipelinesascode.tekton.dev/task: "[task/git-clone/0.1/git-clone.yaml, .tekton/tasks/buildah.yaml, .tekton/tasks/yaml-lint.yaml, .tekton/tasks/e2e-test.yaml, task/sast-snyk-check/0.2/sast-snyk-check.yaml]"
pipelinesascode.tekton.dev/task-2: "yaml-lint"
pipelinesascode.tekton.dev/task: "[task/git-clone/0.1/git-clone.yaml, .tekton/tasks/buildah.yaml, .tekton/tasks/e2e-test.yaml, task/sast-snyk-check/0.2/sast-snyk-check.yaml]"
pipelinesascode.tekton.dev/max-keep-runs: "5"
spec:
params:
Expand Down Expand Up @@ -37,17 +36,6 @@ spec:
value: $(params.revision)
- name: depth
value: "0"
- name: yaml-lint-check
runAfter:
- fetch-repository
taskRef:
name: yaml-lint
workspaces:
- name: shared-workspace
workspace: workspace
params:
- name: args
value: [".", "-c", "/workspace/shared-workspace/source/.yamllint"]
- name: sast-snyk-check
runAfter:
- fetch-repository
Expand All @@ -57,8 +45,6 @@ spec:
- name: workspace
workspace: workspace
- name: build-container
runAfter:
- yaml-lint-check
params:
- name: IMAGE
value: quay.io/konflux-ci/pull-request-builds:appstudio-utils-{{revision}}
Expand Down
50 changes: 0 additions & 50 deletions .tekton/tasks/yaml-lint.yaml

This file was deleted.

1 change: 0 additions & 1 deletion partners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Send a pull request to the [build-definitions](https://github.com/konflux-ci/bui
### How to debug the CI failures in my submitted Task?

Check the logs of the `check-partner-tasks` Task in the `build-definitions-pull-request` PR check.
If you see the Task `yaml-lint-check` has failed, then your Task YAML contains yaml-lint errors.

### Checks

Expand Down

0 comments on commit 2cb065a

Please sign in to comment.