diff --git a/.github/workflows/slsa-publish.yml b/.github/workflows/slsa-publish.yml deleted file mode 100644 index dc633cb..0000000 --- a/.github/workflows/slsa-publish.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: release (slsa 3) -on: - push: - tags: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - outputs: - hashes: ${{ steps.hash.outputs.hashes }} - - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: install devbox - uses: jetpack-io/devbox-install-action@v0.3.0 - - - name: install dependencies - run: devbox run poetry install - - - name: install dependencies - id: build - run: devbox run poetry build - - - name: generate provenance subjects - id: hash - run: | - cd dist - HASHES=$(sha256sum * | base64 -w0) - echo "hashes=$HASHES" >> "$GITHUB_OUTPUT" - - - name: release - uses: softprops/action-gh-release@v0.1.15 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - dist/*.whl - - provenance: - needs: [build] - permissions: - actions: read - id-token: write - contents: write - uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.6.0 - with: - base64-subjects: "${{ needs.build.outputs.hashes }}" - upload-assets: true diff --git a/surplus.py b/surplus.py index b1c67ac..5796b02 100644 --- a/surplus.py +++ b/surplus.py @@ -30,6 +30,7 @@ For more information, please refer to """ from argparse import ArgumentParser +from collections import OrderedDict from sys import stderr from typing import Any, Callable, Final, NamedTuple @@ -188,7 +189,7 @@ def surplus( if debug: stderr.write(f"debug: {location=}\n") - data: list[str] = [ + text: list[str] = [ ( ",".join( [ @@ -241,7 +242,11 @@ def surplus( location["address"].get("country"), ] - return True, "\n".join([d for d in data if ((d != None) and d != "")]) + unique = OrderedDict() + for line in text: + unique.update({line: None}) + + return True, "\n".join([d for d in unique.keys() if ((d != None) and d != "")]) def parse_query(