英文:
How to obtain the sonar.pullrequest.key dynamically
问题
我正在为我的项目设置PR装饰,并在我的sonar-project.properties中添加以下配置:
sonar.pullrequest.provider=GitHub
sonar.pullrequest.github.repository=<repository>
sonar.pullrequest.base=main
sonar.pullrequest.branch=feature/*
sonar.pullrequest.key=5
然而,sonar.pullrequest.key
我不希望它是静态的,而是在每次执行PR装饰的分析时都是最新的。
我正在使用Docker安装,使用Sonar进行分析,以及AWS Codebuild作为CI/CD。
如何始终传递最新的PR呢?
英文:
I am setting PR decoration for my project and I am adding the following configuration in my sonar-project.properties:
sonar.pullrequest.provider=GitHub
sonar.pullrequest.github.repository=<repository>
sonar.pullrequest.base=main
sonar.pullrequest.branch=feature/*
sonar.pullrequest.key=5
However, the sonar.pullrequest.key
I don't want it to be static but every new PR the analysis for the PR decoration is performed.
I am using Docker to install, analyze with Sonar and AWS Codebuild as CI/CD.
How can I pass the most recent PR always?
答案1
得分: 1
以下是翻译好的部分:
sonar.pullrequest.key=${{github.event.pull_request.number}}
sonar.pullrequest.branch=${{github.head_ref}}
sonar.pullrequest.base=${{github.base_ref}}
英文:
For those use GitHub actions to do so, these might help:
sonar.pullrequest.key=${{github.event.pull_request.number}}
sonar.pullrequest.branch=${{github.head_ref}}
sonar.pullrequest.base=${{github.base_ref}}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论