Skip to content

test(app): configure testing environment and add unit tests across entire app #108 and CI #136

Merged
pawelos231 merged 4 commits intomainfrom
109-fix-form-refresh
May 29, 2025
Merged

test(app): configure testing environment and add unit tests across entire app #108 and CI #136
pawelos231 merged 4 commits intomainfrom
109-fix-form-refresh

Conversation

@Braspi
Copy link
Copy Markdown
Member

@Braspi Braspi commented Dec 8, 2024

No description provided.

Vrrrum added 2 commits May 29, 2025 11:26
commit fda5296
Author: Vrrrum <kamil2006wojtek@gmail.com>
Date:   Thu May 29 11:14:53 2025 +0200

    fix(app): Gitignore updated

commit c7631c8
Author: Braspi <shutmer@gmail.com>
Date:   Sun Dec 8 21:08:28 2024 +0100

    test(app): configure testing environment and add unit tests across entire app #108

commit 87abf01
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 20:04:21 2024 +0100

    fix(app): fix portal.tsx

commit 0edfc31
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:37:25 2024 +0100

    fix(app): back to odd

commit 14ba6fe
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:34:43 2024 +0100

    fix(app): fuck eslint 23123

commit e968859
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:24:28 2024 +0100

    fix(app): fuck eslint 2

commit e46a28a
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:23:08 2024 +0100

    fix(app): fuck eslint

commit 72dd97e
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:20:18 2024 +0100

    fix(app): fix portal

commit 64bd1f1
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:15:23 2024 +0100

    fix(app): small fix

commit ca88ca1
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 18:05:09 2024 +0100

    fix(app): small fix

commit 30a32ca
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 17:53:16 2024 +0100

    fix(app): fixed package 2

commit 19bbeb3
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 17:48:06 2024 +0100

    fix(app): fixed package

commit 96df98b
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 17:42:53 2024 +0100

    fix(app): fix for CI

commit ca34a95
Merge: 34b17ca 666010b
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 17:38:43 2024 +0100

    Merge remote-tracking branch 'origin/109-fix-form-refresh' into 109-fix-form-refresh

commit 34b17ca
Author: Braspi <shutmer@gmail.com>
Date:   Sun Nov 24 17:36:41 2024 +0100

    fix(app): fix for CI
@Vrrrum Vrrrum force-pushed the 109-fix-form-refresh branch from fda5296 to 9786790 Compare May 29, 2025 09:29
Comment on lines +13 to +33
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test

- name: Build Next.js app
run: npm run build

build-docker:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 10 months ago

To fix the issue, we will add a permissions block at the root level of the workflow to define the minimum required permissions for all jobs. Based on the workflow's actions, the contents: read permission is sufficient for the build job, as it only checks out the code, installs dependencies, and builds the application. For the build-docker job, additional permissions for accessing secrets and pushing Docker images are required. We will explicitly define these permissions to ensure the workflow adheres to the principle of least privilege.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,2 +10,5 @@
 
+permissions:
+  contents: read
+
 jobs:
@@ -35,2 +38,6 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: read
+      id-token: write
     container:
EOF
@@ -10,2 +10,5 @@

permissions:
contents: read

jobs:
@@ -35,2 +38,6 @@
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
id-token: write
container:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +34 to +59
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
image: gcr.io/kaniko-project/executor:latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Kaniko Configuration
run: |
mkdir -p /kaniko/.docker
echo '{
"auths": {
"${{ secrets.REGISTRY_URL }}": {
"username": "${{ secrets.REGISTRY_USERNAME }}",
"password": "${{ secrets.REGISTRY_PASSWORD }}"
}
}
}' > /kaniko/.docker/config.json

- name: Build and Push Docker Image
run: |
/kaniko/executor \
--context . \
--dockerfile ./Dockerfile \
--destination ${{ secrets.REGISTRY_URL }}/my-app:${{ github.sha }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 10 months ago

To fix the issue, we need to explicitly define the permissions for the workflow and its jobs. Since the workflow primarily interacts with the repository contents (e.g., checking out code), the minimal required permission is contents: read. This permission should be added at the root level of the workflow to apply to all jobs unless overridden. If specific jobs require additional permissions, they can define their own permissions block.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,2 +10,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -10,2 +10,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
@pawelos231 pawelos231 merged commit 637166a into main May 29, 2025
5 checks passed
@pawelos231 pawelos231 deleted the 109-fix-form-refresh branch July 2, 2025 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants