From 62553b5414c45829826649880b0a41f229be3b1b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 00:29:32 +0000 Subject: [PATCH 1/2] Fix is_valid_alias to accept slug characters (hyphens and underscores) Agent-Logs-Url: https://github.com/wahyd4/links/sessions/6f09a469-cf40-4dfe-bafb-9382998551ad Co-authored-by: wahyd4 <836576+wahyd4@users.noreply.github.com> --- links/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/links/views.py b/links/views.py index 1a5fe0c..69b7d90 100644 --- a/links/views.py +++ b/links/views.py @@ -137,7 +137,7 @@ class LinkCreateView(CreateView): return super().form_valid(form) def is_valid_alias(self, alias): - return alias.isalnum() + return bool(re.match(r'^[a-zA-Z0-9_-]+$', alias)) class LinkUpdateView(UpdateView): model = Link @@ -218,7 +218,7 @@ class LinkUpdateView(UpdateView): return reverse('link_detail', kwargs={'pk': self.object.pk}) def is_valid_alias(self, alias): - return alias.isalnum() + return bool(re.match(r'^[a-zA-Z0-9_-]+$', alias)) class LinkDeleteView(DeleteView): model = Link From 609df9ddb5a1d56aa0abb0050a0ad6b5c91cfc9e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 00:36:00 +0000 Subject: [PATCH 2/2] Run tests on pull requests; skip deploy for non-push events Agent-Logs-Url: https://github.com/wahyd4/links/sessions/11e06463-5bc6-44f9-831d-da156cb4977f Co-authored-by: wahyd4 <836576+wahyd4@users.noreply.github.com> --- .github/workflows/build-and-deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 549f4f8..0df0764 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -3,6 +3,7 @@ name: Build and Deploy to Kubernetes on: push: branches: [ main ] + pull_request: env: REGISTRY: ghcr.io @@ -37,6 +38,7 @@ jobs: build-and-deploy: runs-on: ubuntu-latest needs: test + if: github.event_name == 'push' permissions: contents: read packages: write