File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Update Rule Metadata
33on : workflow_dispatch
44
55env :
6- PR_BRANCH_NAME : gh-action/update-rule-metadata
6+ PR_BRANCH_NAME : " gh-action/update-rule-metadata.${{ github.run_id }} "
77
88jobs :
99 UpdateRuleMetadata_job :
@@ -38,12 +38,22 @@ jobs:
3838 distribution : ' temurin'
3939 java-version : ' 21'
4040
41+ - name : Getting Vault Secrets
42+ id : secrets
43+ uses : SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # v3.1.0
44+ with :
45+ secrets : |
46+ development/github/token/{REPO_OWNER_NAME_DASH}-rspec token | GITHUB_TOKEN_RSPEC;
47+
4148 - name : Update Files
49+ env :
50+ GITHUB_TOKEN : ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN_RSPEC }}
4251 run : |
4352 java -jar "/tmp/rule-api.jar" update
4453 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'
4554
4655 - name : Create PR
56+ id : create-pr
4757 env :
4858 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4959 run : |
5262 git checkout -b "${{ env.PR_BRANCH_NAME }}"
5363 git commit -m 'Update rule metadata' -a
5464 git push --set-upstream origin "${{ env.PR_BRANCH_NAME }}"
55- gh pr create -B master --title 'Update rule metadata' --body ''
65+ URL=$(gh pr create -B master --title 'Update rule metadata' --body '')
66+ echo "url=${URL}" >> $GITHUB_OUTPUT
67+
68+ - name : Summary
69+ run : |
70+ echo "Generated ${{steps.create-pr.outputs.url}}." >> $GITHUB_STEP_SUMMARY
71+ echo "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments