firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.28k stars 128 forks source link

feat: add json schema validation with ajv #1167

Closed ANGkeith closed 5 months ago

ANGkeith commented 6 months ago

fixes #859

Main motivation is that the ajv will make gitlab-ci-local less likely to produce false positive

ANGkeith commented 6 months ago

MR should be ready now. the ajv will be a second layer check...

Main motivation is that the ajv will make gitlab-ci-local less likely to produce false positive

Given the following gitlab-ci.yml input:

default:
  tags:
    - 1

foo:
  image: bash
  script:
    - echo
Using fallback branch data
parsing and downloads finished in 28 ms
Invalid gitlab-ci configuration! It have failed the json schema validation. Dump the following to the pipeline editor to debug:
    stages:
  - .pre
  - build
  - test
  - deploy
  - .post
default:
  tags:
    - 1
foo:
  image:
    name: bash
  script:
    - echo

NOTE: This is beta feature, which can be disabled with `gitlab-ci-local --enable-json-schema-validation=false`
sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
96.4% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

firecow commented 5 months ago

@ANGkeith I've approved, I'll test and publish a new version tomorrow, if you have merged this by then.