Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Q&D python for command line to validate .gitlab-ci.yml
#! /usr/bin/python
# script to validate .gitlab-ci.yml
import sys
import requests
import json
def main():
r ="", json={ 'content': file(sys.argv[1], 'r').read() })
if r.status_code !=['OK']:
data = r.json()
if data['status'] != 'valid':
for e in data['errors']:
print >> sys.stderr, e
sys.exit(0) # valid
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.