Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TCE-1038] Project token passed through environment variable CODACY_PROJECT_TOKEN is empty #128

Open
amedee opened this issue Jul 8, 2024 · 1 comment

Comments

@amedee
Copy link

amedee commented Jul 8, 2024

This is my .github/workflows/codacy.yml:

---
name: Codacy Security Scan

on:
  schedule:
    - cron: '19 8 * * 2'
  workflow_call:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  codacy-security-scan:
    permissions:
      actions: read
      contents: read
      security-events: write
    name: Codacy Security Scan
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Run Codacy Analysis CLI
        uses: codacy/codacy-analysis-cli-action@3ff8e64eb4b714c4bee91b7b4eea31c6fc2c4f93
        with:
          project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
          verbose: true
          output: results.sarif
          format: sarif
          gh-code-scanning-compat: true
          max-allowed-issues: 2147483647

      - name: Upload SARIF results file
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

In GitHub, on the page .../settings/secrets/actions, I have defined a repository secret CODACY_PROJECT_TOKEN, with the value I took from the page "Setting up code coverage" on https://app.codacy.com/.

When running this job, I get this error:

07/08 22:52:16 INFO  c.c.a.c.c.Environment:72 - Project token not passed through argument `--project-token` 
07/08 22:52:16 INFO  c.c.a.c.c.Environment:72 - API token not passed through argument `--api-token` 
07/08 22:52:16 WARN  c.c.a.c.c.Environment:77 - Project token passed through environment variable `CODACY_PROJECT_TOKEN` is empty 
07/08 22:52:16 WARN  c.c.a.c.c.Environment:77 - API token passed through environment variable `CODACY_API_TOKEN` is empty 
07/08 22:52:16 WARN  c.c.a.cli.clients.Credentials:30 - Could not retrieve credentials 

How do I fix this?

Copy link

github-actions bot commented Jul 8, 2024

Internal ticket created : TCE-1038

@github-actions github-actions bot changed the title Project token passed through environment variable CODACY_PROJECT_TOKEN is empty [TCE-1038] Project token passed through environment variable CODACY_PROJECT_TOKEN is empty Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant