Skip to content

Add GitHub Action to lint jsonnet #5

Add GitHub Action to lint jsonnet

Add GitHub Action to lint jsonnet #5

Workflow file for this run

name: Jsonnet Lint
on:
pull_request:
paths:
- 'otterdog/eclipse-csi.jsonnet'
- '.github/workflows/jsonnet-lint.yml'
push: # temporary for testing
env:
JSONNET_FILE: otterdog/eclipse-csi.jsonnet
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install
run: |
go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Check format
run: |
if ! jsonnetfmt --test ${{ env.JSONNET_FILE }}; then
echo "Bad format. Run 'jsonnetfmt -i ${{ env.JSONNET_FILE }}' locally\n\n""
jsonnetfmt -i ${{ env.JSONNET_FILE }} && git diff
exit 1
fi