Skip to content

Commit 9e702bf

Browse files
authored
Fix bug in dependency update workflow. (#685)
* Fix bug with logfile if --skip_android is set. * Fix workflow to handle missing logfile.
1 parent 6b465d7 commit 9e702bf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/update-dependencies.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,16 @@ jobs:
8787
echo "::error ::Neither Android nor iOS selected. Exiting."
8888
exit 1
8989
fi
90+
touch ${UPDATE_LOGFILE} # In case it wasn't generated before
91+
cat ${UPDATE_LOGFILE}
9092
9193
- name: Push branch if there are changes
9294
id: push-branch
9395
run: |
9496
if ! git update-index --refresh; then
9597
# Do a bit of post-processing on the update log to split it by platform.
9698
UPDATE_LOGFILE_PROCESSED=update_log_processed.txt
99+
touch "${UPDATE_LOGFILE_PROCESSED}"
97100
if grep -q ^Android: "${UPDATE_LOGFILE}"; then
98101
echo "### Android" >> "${UPDATE_LOGFILE_PROCESSED}"
99102
echo "" >> "${UPDATE_LOGFILE_PROCESSED}"

scripts/update_android_ios_dependencies.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ def parse_cmdline_args():
738738
logfile_lines = set()
739739

740740
def main():
741+
global logfile_lines
742+
741743
args = parse_cmdline_args()
742744
# Readme files have to be updated for both Android and iOS dependencies.
743745
readme_files = get_files(args.readmefiles, file_extension='.md',
@@ -772,9 +774,9 @@ def main():
772774
for gradle_file in gradle_files:
773775
modify_gradle_file(gradle_file, latest_android_versions_map, args.dryrun)
774776

775-
if args.logfile:
776-
with open(args.logfile, 'w') as logfile_file:
777-
logfile_file.write("\n".join(sorted(list(logfile_lines))) + "\n")
777+
if args.logfile:
778+
with open(args.logfile, 'w') as logfile_file:
779+
logfile_file.write("\n".join(sorted(list(logfile_lines))) + "\n")
778780

779781
if __name__ == '__main__':
780782
main()

0 commit comments

Comments
 (0)