Github Action for sonarcloud

Hello Everyone,

Thank you for your support,

We recently bought paid subscription for SonarCloud, I want to run sonarscan through github-actions, but I always get the below error.
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.organization

below is my pipline.

name: SonarCloud Scan

on:
  push:
    branches:
      - codescan
  
jobs:
  build:
    runs-on: ubuntu-latest

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

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

      - name: Build with NPM
        run: npm install
  
      - name: SonarCloud Scan
        uses: sonarsource/sonarcloud-github-action@master
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
          SONAR_PROJECT_KEY: "organizarion"
          SONAR_PROJECT_NAME: "github repo name"
        with: 
          projectBaseDir: .

Any help is appreciated.

Thanks
Niranjan

The analysis tutorial tells you to create a sonar.project.properties file like this:

sonar.projectName=projectname
sonar.organization=organization 

Those environment variables are doing nothing.

Thank You Colin for you Reply.
I think below variables are needed, if we run sonarscan in the command line.

sonar.projectName=projectname
sonar.organization-organization

Thanks
Niranjan