Skip to content

Commit

Permalink
fixup! chore: add errors as messages in cloud-init lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
cdunster committed Jan 31, 2025
1 parent c302932 commit cf0241d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ jobs:
run: sudo apt-get install -y cloud-init
- name: Lint cloud-init file
run: |
cloud-init schema -c cloud-init.yaml >> $GITHUB_STEP_SUMMARY 2> >(tee stderr.log)
cat stderr.log | grep "in.*line.*column" -A1 --no-group-separator | sed -z 's/in "\([^"]*\)", line \([[:digit:]]\+\), column \([[:digit:]]\+\):\s*/::error file=cloud-init.yaml,title=\1,line=\2,col=\3::/g'
if ! cloud-init schema -c cloud-init.yaml 2> >(tee stderr.log) >> $GITHUB_STEP_SUMMARY
then
# Print errors as such in GitHub logs.
cat stderr.log | grep "in.*line.*column" -A1 --no-group-separator | sed -z 's/in "\([^"]*\)", line \([[:digit:]]\+\), column \([[:digit:]]\+\):\s*/::error file=cloud-init.yaml,title=\1,line=\2,col=\3::/g'
exit 1
fi
preview:
runs-on: ubuntu-latest
Expand Down

0 comments on commit cf0241d

Please sign in to comment.