From: Sebastián Ramírez Date: Thu, 17 Mar 2022 18:36:21 +0000 (-0500) Subject: 🐛 Fix FastAPI People generation to include missing file in commit (#4695) X-Git-Tag: 0.75.1~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3eb78709030650f24f5e31730f47591d6cef4cb;p=thirdparty%2Ffastapi%2Ffastapi.git 🐛 Fix FastAPI People generation to include missing file in commit (#4695) --- diff --git a/.github/actions/people/app/main.py b/.github/actions/people/app/main.py index dc0bbc4c0a..0b6ff4063c 100644 --- a/.github/actions/people/app/main.py +++ b/.github/actions/people/app/main.py @@ -501,9 +501,16 @@ if __name__ == "__main__": github_sponsors_path = Path("./docs/en/data/github_sponsors.yml") people_old_content = people_path.read_text(encoding="utf-8") github_sponsors_old_content = github_sponsors_path.read_text(encoding="utf-8") - new_people_content = yaml.dump(people, sort_keys=False, width=200, allow_unicode=True) - new_github_sponsors_content = yaml.dump(github_sponsors, sort_keys=False, width=200, allow_unicode=True) - if people_old_content == new_people_content and github_sponsors_old_content == new_github_sponsors_content: + new_people_content = yaml.dump( + people, sort_keys=False, width=200, allow_unicode=True + ) + new_github_sponsors_content = yaml.dump( + github_sponsors, sort_keys=False, width=200, allow_unicode=True + ) + if ( + people_old_content == new_people_content + and github_sponsors_old_content == new_github_sponsors_content + ): logging.info("The FastAPI People data hasn't changed, finishing.") sys.exit(0) people_path.write_text(new_people_content, encoding="utf-8") @@ -517,7 +524,9 @@ if __name__ == "__main__": logging.info(f"Creating a new branch {branch_name}") subprocess.run(["git", "checkout", "-b", branch_name], check=True) logging.info("Adding updated file") - subprocess.run(["git", "add", str(people_path)], check=True) + subprocess.run( + ["git", "add", str(people_path), str(github_sponsors_path)], check=True + ) logging.info("Committing updated file") message = "👥 Update FastAPI People" result = subprocess.run(["git", "commit", "-m", message], check=True)