0

I tried to built github .yml file but I’m getting error like

|GitHub Actions/ Main Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 22, Col: 22): Unexpected symbol: '<hash_value>'. Located at position 9 within expression: secrets.<hash_value>|

CODE

on:

Trigger analysis when pushing in master or pull requests, and when creating
a pull request.
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
name: Main Workflow
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v1.3
env:
GITHUB_TOKEN: {{ secrets.<hash_value>}} SONAR_TOKEN: {{ secrets.<hash_value>}}

AND

#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here

#----- Default SonarQube server
sonar.host.url=https://sonarcloud.io/

#----- Default source code encoding
#sonar.sourceEncoding=UTF-8

sonar.organization=blah blah
sonar.projectKey=blah blah

— optional properties —
defaults to project key
sonar.projectName=Toolsdemo

defaults to ‘not provided’
sonar.projectVersion=1.0

Path is relative to the sonar-project.properties file. Defaults to . sonar.sources=https://github.com/abcd/xyz

Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8

Please help . I need to test my code very fast .

Maximious
  • 155
  • 2
  • 12

0 Answers0