Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/binding-publish-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ name: Publish bindings to every registry

on:
workflow_run:
workflows: [Generate and commit Go, Python, TypeScript and Java bindings]
# Quoted: the name has commas, which would otherwise split it into three names.
workflows: ["Generate and commit Go, Python, TypeScript and Java bindings"]
types: [completed]
branches: [main]
workflow_dispatch:
Expand Down
9 changes: 9 additions & 0 deletions tooling/extension-bindings/ci/test_publish_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,14 @@ def test_no_card_when_nothing_needs_setup(self) -> None:
self.assertIsNone(script.setup_card(findings, lambda url: None))


class WorkflowTests(unittest.TestCase):
def test_publishing_follows_the_generation_workflow_by_its_exact_name(self) -> None:
workflows = Path(__file__).parents[3] / ".github/workflows"
generate = yaml.safe_load((workflows / "binding-generate.yml").read_text(encoding="utf-8"))
publish = yaml.safe_load((workflows / "binding-publish-all.yml").read_text(encoding="utf-8"))
# A name with commas inside an unquoted [ ] list is read as several names, and nothing triggers.
self.assertEqual(publish[True]["workflow_run"]["workflows"], [generate["name"]])


if __name__ == "__main__":
unittest.main()