From 9d4cfb761124a328db70121af6dac56c00698609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Tue, 1 Oct 2024 14:49:18 +0100 Subject: [PATCH 01/15] test cli v2 --- .github/workflows/codacy.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 987e4cb..6e5865f 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -20,17 +20,10 @@ jobs: with: node-version: '18' # Choose your Node.js version - - name: Run Codacy Analysis CLI with Docker (optional) - run: | - export CODACY_CODE=$GITHUB_WORKSPACE - docker run \ - --rm=true \ - --env CODACY_CODE="$CODACY_CODE" \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - --volume "$CODACY_CODE":"$CODACY_CODE" \ - --volume /tmp:/tmp \ - codacy/codacy-analysis-cli \ - analyze --tool eslint --upload --project-token ${{ secrets.CODACY_PROJECT_TOKEN }} --max-allowed-issues 99999 --commit-uuid $GITHUB_SHA + - name: Run Codacy CLI + uses: codacy/codacy-cli-v2-action@main + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - name: Install dependencies run: | From ca5d23140fe2e7bcea5073ffb580fbfd4a7164a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Tue, 1 Oct 2024 14:56:38 +0100 Subject: [PATCH 02/15] downloading correct version --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 6e5865f..a6b6d96 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@main + uses: codacy/codacy-cli-v2-action@tests with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} From 4d83ecb529cd0eb80946c7ce36f227ca4cb53a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 2 Oct 2024 10:10:34 +0100 Subject: [PATCH 03/15] add config file --- .codacy/codacy.yaml | 4 ++++ .github/workflows/codacy.yml | 1 + eslint.config.mjs | 6 ++++++ 3 files changed, 11 insertions(+) create mode 100644 .codacy/codacy.yaml create mode 100644 eslint.config.mjs diff --git a/.codacy/codacy.yaml b/.codacy/codacy.yaml new file mode 100644 index 0000000..c2cccd0 --- /dev/null +++ b/.codacy/codacy.yaml @@ -0,0 +1,4 @@ +runtimes: + - node@22.2.0 +tools: + - eslint@8.57.0 diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index a6b6d96..72abf27 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -24,6 +24,7 @@ jobs: uses: codacy/codacy-cli-v2-action@tests with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + tool: eslint - name: Install dependencies run: | diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b593178 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,6 @@ +export default [ + { + rules: { + } + } +]; \ No newline at end of file From 5dcb44360cae896bf4cf180a9e56b606714daeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 2 Oct 2024 10:22:50 +0100 Subject: [PATCH 04/15] upload report --- .github/workflows/codacy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 72abf27..a94157f 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -25,6 +25,7 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} tool: eslint + upload_report: true - name: Install dependencies run: | From 9baa2b02622ee65d0dfd99bd78e8e0df2ff97566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 2 Oct 2024 10:46:47 +0100 Subject: [PATCH 05/15] fix token parameter --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index a94157f..951e197 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -23,7 +23,7 @@ jobs: - name: Run Codacy CLI uses: codacy/codacy-cli-v2-action@tests with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + project_token: ${{ secrets.CODACY_PROJECT_TOKEN }} tool: eslint upload_report: true From 451e77b96bd5580422764b86727150281d419e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 9 Oct 2024 16:39:34 +0100 Subject: [PATCH 06/15] update branch for gh action --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 951e197..c28cde9 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@tests + uses: codacy/codacy-cli-v2-action@add_api_token_to_upload with: project_token: ${{ secrets.CODACY_PROJECT_TOKEN }} tool: eslint From 62c2a547fbaa0be8857863ace4c669826ac69ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 9 Oct 2024 16:42:39 +0100 Subject: [PATCH 07/15] test api token --- .github/workflows/codacy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index c28cde9..9cd689a 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -23,9 +23,12 @@ jobs: - name: Run Codacy CLI uses: codacy/codacy-cli-v2-action@add_api_token_to_upload with: - project_token: ${{ secrets.CODACY_PROJECT_TOKEN }} + api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint upload_report: true + provider: gh + owner: codacy-acme + repository: sample-javascript-project - name: Install dependencies run: | From 0614719cc7717309cfa9d8c657419554c4911310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Rocha?= Date: Wed, 9 Oct 2024 16:49:44 +0100 Subject: [PATCH 08/15] update gh action branch --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 9cd689a..077ba09 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@add_api_token_to_upload + uses: codacy/codacy-cli-v2-action@main with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From 089a6586e4700871e9f4010d7f28b773c9783cb2 Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:03:29 +0100 Subject: [PATCH 09/15] Update codacy.yml --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 077ba09..37c824c 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@main + uses: codacy/codacy-cli-v2-action@test-file-cleanup with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From eb2f47f4fb962391236f7f09dbadfd7df1649504 Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:31:56 +0100 Subject: [PATCH 10/15] Update codacy.yml --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 37c824c..a1fa55d 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@test-file-cleanup + uses: codacy/codacy-cli-v2-action@8826e22b167ac80e1ee2e1b8ea82bbf42c20dec4 with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From 7c5db3bd324adddf2cce2570cfcc66e434f8725d Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:45:36 +0100 Subject: [PATCH 11/15] Update codacy.yml --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index a1fa55d..37c824c 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@8826e22b167ac80e1ee2e1b8ea82bbf42c20dec4 + uses: codacy/codacy-cli-v2-action@test-file-cleanup with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From 0b4640fd36dd9eb267d96709854d59afae912121 Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:59:55 +0100 Subject: [PATCH 12/15] Update codacy.yml --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 37c824c..077ba09 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -21,7 +21,7 @@ jobs: node-version: '18' # Choose your Node.js version - name: Run Codacy CLI - uses: codacy/codacy-cli-v2-action@test-file-cleanup + uses: codacy/codacy-cli-v2-action@main with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From 19507300f949cd0c7768afcce9945f9314ce8c71 Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:31:51 +0000 Subject: [PATCH 13/15] Update codacy.yml --- .github/workflows/codacy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 077ba09..e64166a 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -22,6 +22,8 @@ jobs: - name: Run Codacy CLI uses: codacy/codacy-cli-v2-action@main + env: + GH_TOKEN: ${{ secrets.GH_TOKEN}} with: api_token: ${{ secrets.CODACY_API_TOKEN }} tool: eslint From 082094ce15c8446acd5934e98a3bb85bd2d7fa0f Mon Sep 17 00:00:00 2001 From: heliocodacy <46491761+heliocodacy@users.noreply.github.com> Date: Fri, 16 May 2025 10:21:36 +0100 Subject: [PATCH 14/15] move to eslint9 --- .github/workflows/codacy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index e64166a..2f65bd4 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -26,7 +26,7 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN}} with: api_token: ${{ secrets.CODACY_API_TOKEN }} - tool: eslint + tool: eslint9 upload_report: true provider: gh owner: codacy-acme From 746ed231642fc9b5f226b9338a49a525033ac778 Mon Sep 17 00:00:00 2001 From: Joao Machado <13315199+machadoit@users.noreply.github.com> Date: Thu, 4 Sep 2025 16:48:39 +0200 Subject: [PATCH 15/15] Some test --- main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.js b/main.js index 40c8aba..3d3087f 100644 --- a/main.js +++ b/main.js @@ -5,9 +5,17 @@ const { add, subtract } = require('./util'); // Function to add two numbers function addNumbers(a, b) { + console.log('Adding numbers:', a, b); return add(a, b); } + +// Function to multiply two numbers +function multiplyNumbers(a, b) { + console.log('Multiplying numbers:', a, b); + return a * b; +} + // Function to subtract two numbers function subtractNumbers(a, b) { return subtract(a, b);