Update Rule Metadata #19
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Rule Metadata | |
| on: workflow_dispatch | |
| env: | |
| PR_BRANCH_NAME: gh-action/update-rule-metadata | |
| jobs: | |
| UpdateRuleMetadata_job: | |
| name: Update Rule Metadata | |
| runs-on: ubuntu-latest-large | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v4 | |
| - name: Setup JFrog | |
| uses: SonarSource/jfrog-setup-wrapper@v3 | |
| with: | |
| artifactoryRoleSuffix: private-reader | |
| - name: Setup Rule API | |
| run: | | |
| jfrog rt download --flat=true "sonarsource-private-releases/com/sonarsource/rule-api/rule-api/%5BRELEASE%5D/rule-api-%5BRELEASE%5D.jar" /tmp/rule-api.jar | |
| echo "Latest com.sonarsource.rule-api:rule-api release:" | |
| unzip -p /tmp/rule-api.jar META-INF/MANIFEST.MF | grep 'Implementation-Version' | |
| working-directory: /tmp | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Update Files | |
| run: | | |
| java -jar "/tmp/rule-api.jar" update | |
| 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' | |
| # - name: Create PR | |
| # env: | |
| # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # run: | | |
| # git config user.name "${GITHUB_ACTOR}" | |
| # git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| # git checkout -b "${{ env.PR_BRANCH_NAME }}" | |
| # git commit -m 'Update rule metadata' -a | |
| # git push --set-upstream origin "${{ env.PR_BRANCH_NAME }}" | |
| # gh pr create -B master --title 'Update rule metadata' --body '' |