File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Update Rule Metadata
2+
3+ on : workflow_dispatch
4+
5+ env :
6+ RULE_API_VERSION : 2.10.0.4287
7+ PR_BRANCH_NAME : gh-action/update-rule-metadata
8+
9+ jobs :
10+ UpdateRuleMetadata_job :
11+ name : Update Rule Metadata
12+ runs-on : ubuntu-latest
13+ permissions :
14+ pull-requests : write
15+ contents : write
16+ id-token : write
17+
18+ steps :
19+
20+ - name : Checkout Sources
21+ uses : actions/checkout@v4
22+
23+ - name : Setup JFrog
24+ uses : SonarSource/jfrog-setup-wrapper@v3
25+ with :
26+ artifactoryRoleSuffix : private-reader
27+
28+ - name : Setup Rule API
29+ run : |
30+ jfrog rt download "sonarsource-private-releases/com/sonarsource/rule-api/rule-api/${{ env.RULE_API_VERSION }}/rule-api-${{ env.RULE_API_VERSION }}.jar" --flat
31+ working-directory : /tmp
32+
33+ - name : Setup Java
34+ uses : actions/setup-java@v4
35+ with :
36+ distribution : ' temurin'
37+ java-version : ' 21'
38+
39+ - name : Update Files
40+ run : |
41+ java -jar "/tmp/rule-api-${{ env.RULE_API_VERSION }}.jar" update
42+ sed --in-place='' -e 's/rule:java:S3649/rule:javasecurity:S3649/g' 'sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2077.html'
43+
44+ - name : Create PR
45+ env :
46+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+ run : |
48+ git config user.name "${GITHUB_ACTOR}"
49+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
50+ git checkout -b "${{ env.PR_BRANCH_NAME }}"
51+ git commit -m 'Update rule metadata' -a
52+ git push --set-upstream origin "${{ env.PR_BRANCH_NAME }}"
53+ gh pr create -B master --title 'Update rule metadata' --body ''
You can’t perform that action at this time.
0 commit comments