Skip to content

Commit 8e26aa6

Browse files
committed
debug
1 parent dcc858f commit 8e26aa6

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

.github/workflows/lib/yaml_to_json.py

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
1-
#!/bin/bash
2-
3-
# PROPRIETARY AND CONFIDENTIAL
4-
#
5-
# Unauthorized copying of this project via any medium is strictly prohibited.
6-
#
7-
# Copyright (c) 2020-2020 Snowplow Analytics Ltd. All rights reserved.
8-
9-
# Generate the JSON equivalent of the yaml file with the list of referers
10-
111
import sys
12-
import json
132
import yaml
3+
import json
144

15-
if len(sys.argv) != 3:
16-
print 'USAGE: yaml_to_json.py <input_referers.yaml> <output_referers.json>'
17-
print '2 arguments must be specified'
18-
print 'Arguments:'
19-
print sys.argv[1:]
20-
sys.exit(1)
21-
22-
input_yaml = sys.argv[1]
23-
output_json = sys.argv[2]
24-
25-
referers = yaml.load(open(input_yaml))
26-
json = json.dumps(referers, sort_keys = False, indent = 4)
5+
with open(sys.argv[1], 'r') as input:
6+
yml = yaml.safe_load(input)
277

28-
print "writing to {0} ".format(output_json)
29-
with open(output_json, 'w') as f:
30-
f.write(json)
8+
with open(sys.argv[2], 'w') as output:
9+
json.dump(yml, output)

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
#- uses: actions/setup-python@v4
11-
# with:
12-
# python-version: '2.7.0'
1310
- name: Convert yaml to json
1411
run: python .github/workflows/lib/yaml_to_json.py resources/referers.yml referers.json
1512
- name: Check

0 commit comments

Comments
 (0)