0

我尝试构建 github .yml 文件,但出现类似错误

|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>|

代码

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

路径相对于 sonar-project.properties 文件。默认为 . sonar.sources=https://github.com/abcd/xyz

源代码的编码。默认为默认系统编码 sonar.sourceEncoding=UTF-8

请帮忙 。我需要非常快速地测试我的代码。

4

0 回答 0