diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index b0e4ed5..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [ push ] -jobs: - build: - runs-on: fz - steps: - - uses: actions/checkout@v3 - - uses: docker/medatada-action@3 - id: medatada - with: - images: git.roboces.dev/${{ gitea.repository }} - - uses: docker/login-action@v1 - with: - registry: git.roboces.dev - username: ${{ gitea.actor }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - uses: int128/kaniko-action@v1 - with: - push: true - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} - cache: true - cache-repository: gitea.roboces.dev/${{ gitea.repository }}/cache \ No newline at end of file diff --git a/secretsanta/domain.py b/secretsanta/domain.py index 458adbc..e3d958a 100644 --- a/secretsanta/domain.py +++ b/secretsanta/domain.py @@ -15,20 +15,10 @@ class Group(BaseModel): @staticmethod def pair(names: list[str]) -> dict[str, str]: - names_copy = names[:] - random.shuffle(names_copy) - - pairings = {} - for i, name in enumerate(names): - pair = names_copy[i] - while pair == name: - random.shuffle(names_copy) - pair = names_copy[i] - - pairings[name] = pair - - return pairings - + random.shuffle(names) + names_copy = names[1:] + names_copy.append(names[0]) + return dict(zip(names, names_copy)) class IRepo(ABC): @abstractmethod