From 8d9826eba3ef0eceb336f054cce2ff3d8b5d6488 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:13:52 +0000 Subject: [PATCH 1/8] Initial plan From 736212f21ab78c8472fc1459852adb17a52f88cc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:16:34 +0000 Subject: [PATCH 2/8] Add GitHub Actions workflow for PR linting Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b43e44e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: + pull_request: + branches: ['*'] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linting + run: npm run lint From 89aa1e960e9fa24c2f3599d1002abaf2e0cba695 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:17:29 +0000 Subject: [PATCH 3/8] Simplify workflow trigger configuration Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b43e44e..cb87731 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,7 +2,6 @@ name: Lint on: pull_request: - branches: ['*'] jobs: lint: From 6ba2f9b6977d1e6937dabeb7fa3c9eb8c7ca0012 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:19:00 +0000 Subject: [PATCH 4/8] Add explicit permissions to workflow for security Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cb87731..eb27ca9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,8 @@ on: jobs: lint: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout code From 4dbd3b545fbf0d105e1e662383d981499dab7047 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:26:27 +0000 Subject: [PATCH 5/8] Add auto-fix capability to linting workflow Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eb27ca9..9e7c19f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ jobs: lint: runs-on: ubuntu-latest permissions: - contents: read + contents: write steps: - name: Checkout code @@ -22,5 +22,26 @@ jobs: - name: Install dependencies run: npm ci - - name: Run linting + - name: Run linting with auto-fix + run: npm run lint:fix + + - name: Check for changes + id: check_changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "changes=true" >> $GITHUB_OUTPUT + else + echo "changes=false" >> $GITHUB_OUTPUT + fi + + - name: Commit and push fixes + if: steps.check_changes.outputs.changes == 'true' + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add . + git commit -m "Auto-fix linting issues" + git push + + - name: Run linting check run: npm run lint From 5c473c5967019dcbd76505d3eb101b9842753352 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:27:32 +0000 Subject: [PATCH 6/8] Improve workflow with proper token and error handling Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9e7c19f..51e64d6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -41,7 +44,7 @@ jobs: git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add . git commit -m "Auto-fix linting issues" - git push + git push || echo "Unable to push fixes (likely due to fork restrictions)" - name: Run linting check run: npm run lint From 67f1e5153aefb0a567dded8fda22f244fc26a497 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 11:34:39 +0000 Subject: [PATCH 7/8] Revert to simple linting check without auto-fix Co-authored-by: JohnMarsden24 <55828757+JohnMarsden24@users.noreply.github.com> --- .github/workflows/lint.yml | 28 ++-------------------------- package.json | 1 - 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 51e64d6..eb27ca9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,14 +7,11 @@ jobs: lint: runs-on: ubuntu-latest permissions: - contents: write + contents: read steps: - name: Checkout code uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.head_ref }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -25,26 +22,5 @@ jobs: - name: Install dependencies run: npm ci - - name: Run linting with auto-fix - run: npm run lint:fix - - - name: Check for changes - id: check_changes - run: | - if [ -n "$(git status --porcelain)" ]; then - echo "changes=true" >> $GITHUB_OUTPUT - else - echo "changes=false" >> $GITHUB_OUTPUT - fi - - - name: Commit and push fixes - if: steps.check_changes.outputs.changes == 'true' - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git add . - git commit -m "Auto-fix linting issues" - git push || echo "Unable to push fixes (likely due to fork restrictions)" - - - name: Run linting check + - name: Run linting run: npm run lint diff --git a/package.json b/package.json index 685bb1a..e13a5dc 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "dev": "vite", "build": "tsc -b && vite build", "lint": "eslint .", - "lint:fix": "eslint . --fix", "preview": "vite preview" }, "dependencies": { From 5b24f07847cb4c9a1b2856e4c547357677d4e0bd Mon Sep 17 00:00:00 2001 From: johnmarsden24 Date: Fri, 2 Jan 2026 11:37:38 +0000 Subject: [PATCH 8/8] rebased --- src/contexts/CartContext.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contexts/CartContext.tsx b/src/contexts/CartContext.tsx index 2b59177..4d0f7b1 100644 --- a/src/contexts/CartContext.tsx +++ b/src/contexts/CartContext.tsx @@ -1,4 +1,4 @@ -import { createContext, useContext } from 'react'; +import { createContext } from 'react'; import type { ReactNode } from 'react'; import { useCart } from '../hooks/useCart';