File tree 1 file changed +14
-2
lines changed 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,25 @@ def get_current_info():
96
96
response = response .json ()
97
97
98
98
git_info = commit_sha , response ["sha" ]
99
- return git_info , json .loads (base64 .b64decode (response ["content" ]).decode ("utf-8" ))
99
+ current_list = json .loads (base64 .b64decode (response ["content" ]).decode ("utf-8" ))
100
+ current_info = {}
101
+ for info in current_list :
102
+ current_info [info ["id" ]] = info
103
+ return git_info , current_info
100
104
101
105
def create_pr (changes , updated , git_info ):
102
106
commit_sha , original_blob_sha = git_info
103
107
branch_name = "new_release_" + changes ["new_release" ]
104
108
105
- updated = json .dumps (updated , sort_keys = True , indent = 4 ).encode ("utf-8" ) + b"\n "
109
+ # Convert the dictionary to a list of boards. Liquid templates only handle arrays.
110
+ updated_list = []
111
+ all_ids = sorted (updated .keys ())
112
+ for id in all_ids :
113
+ info = updated [id ]
114
+ info ["id" ] = id
115
+ updated_list .append (info )
116
+
117
+ updated = json .dumps (updated_list , sort_keys = True , indent = 4 ).encode ("utf-8" ) + b"\n "
106
118
print (updated .decode ("utf-8" ))
107
119
pr_title = "Automated website update for release {}" .format (changes ["new_release" ])
108
120
boards = ""
You can’t perform that action at this time.
0 commit comments