Skip to content

Commit

Permalink
Check the linting working by changing a yaml file
Browse files Browse the repository at this point in the history
Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com>
  • Loading branch information
hansinikarunarathne committed Jul 19, 2024
1 parent 8debcd9 commit a290e0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/yaml_formatter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ jobs:
run: cat changed_files_in_PR.txt

- name: Run yamllint on changed files
if: steps.changed_files.outputs.changed_files != ''
run: |
cat changed_files_in_PR.txt | xargs -I {} yamllint {} || echo "No changes needed for the YAML files."
if [ -s changed_files_in_PR.txt ]; then
cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1
else
echo "No YAML files have changed in this PR."
fi
shell: bash

- name: Check YAML lint results
if: success()
run: echo "No styling issues with YAML files."
shell: bash
12 changes: 6 additions & 6 deletions common/cert-manager/cert-manager/base/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: certificaterequests.cert-manager.io
labels:
app: 'cert-manager'
app.kubernetes.io/name: 'cert-manager'
app.kubernetes.io/instance: 'cert-manager'
# Generated labels
app.kubernetes.io/version: "v1.14.5"
labels:

Check failure on line 25 in common/cert-manager/cert-manager/base/cert-manager.yaml

View workflow job for this annotation

GitHub Actions / format_YAML_files

25:13 syntax error: mapping values are not allowed here (syntax)
app: 'cert-manager'
app.kubernetes.io/name: 'cert-manager'
app.kubernetes.io/instance: 'cert-manager'
# Generated labels
app.kubernetes.io/version: "v1.14.5"
spec:
group: cert-manager.io
names:
Expand Down

0 comments on commit a290e0d

Please sign in to comment.