2 Commits

Author SHA1 Message Date
dependabot[bot] 6e0d653c72 Bump specklesystems/speckle-automate-github-composite-action (#1)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
Bumps [specklesystems/speckle-automate-github-composite-action](https://github.com/specklesystems/speckle-automate-github-composite-action) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/specklesystems/speckle-automate-github-composite-action/releases)
- [Commits](https://github.com/specklesystems/speckle-automate-github-composite-action/compare/0.8.0...0.8.1)

---
updated-dependencies:
- dependency-name: specklesystems/speckle-automate-github-composite-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 08:40:04 +00:00
Jonathon Broughton bcdf172982 Update flatten.py 2024-03-12 08:39:45 +00:00
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ jobs:
run: |
python main.py generate_schema ${HOME}/${{ env.FUNCTION_SCHEMA_FILE_NAME }}
- name: Speckle Automate Function - Build and Publish
uses: specklesystems/speckle-automate-github-composite-action@0.8.0
uses: specklesystems/speckle-automate-github-composite-action@0.8.1
with:
speckle_automate_url: ${{ env.SPECKLE_AUTOMATE_URL || 'https://automate.speckle.dev' }}
speckle_token: ${{ secrets.SPECKLE_FUNCTION_TOKEN }}
+5 -3
View File
@@ -7,7 +7,9 @@ from specklepy.objects import Base
def flatten_base(base: Base) -> Iterable[Base]:
"""Take a base and flatten it to an iterable of bases."""
if hasattr(base, "elements"):
for element in base["elements"]:
yield from flatten_base(element)
if hasattr(base, "elements") and base.elements is not None:
# Check if base.elements is not only present and non-None, but also an iterable
if isinstance(base.elements, Iterable):
for element in base.elements:
yield from flatten_base(element)
yield base