Skip to content

Commit e284917

Browse files
SCANMAVEN-284 Bump releasability workflow version (#294)
1. Migrate releasability check to the new version. 2. Change the group id of the propery dump plugin to bypass releasability check (it is not released).
1 parent cb6dd58 commit e284917

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

.github/workflows/releasability.yaml

+38-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Releasability status
22

33
on:
44
workflow_dispatch:
5+
# Inputs the workflow accepts.
6+
inputs:
7+
version:
8+
description: Optional; Used to specify the version to check, otherwise pulls the latest master version from artifactory.
9+
required: false
510

611
jobs:
712
update_releasability_status:
@@ -11,6 +16,38 @@ jobs:
1116
id-token: write
1217
contents: read
1318
steps:
14-
- uses: SonarSource/gh-action_releasability/releasability-status@23c9ad31b2d613bade88da898dfdca0b5c65ac69 # v1.2.1
19+
- name: Retrieve Vault Secrets
20+
id: secrets
21+
uses: SonarSource/vault-action-wrapper@v3
22+
with:
23+
secrets: |
24+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader access_token | ARTIFACTORY_PASSWORD;
25+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-private-reader role | ARTIFACTORY_ROLE;
26+
development/kv/data/repox url | ARTIFACTORY_URL;
27+
- name: Get the latest available version number
28+
id: latest-version
29+
env:
30+
ARTIFACTORY_PRIVATE_USERNAME: vault-${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ROLE }}
31+
ARTIFACTORY_PRIVATE_PASSWORD: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_PASSWORD }}
32+
ARTIFACTORY_URL: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_URL }}
33+
REPO: sonarsource-public-builds
34+
GROUP_ID: org.sonarsource.scanner.maven
35+
ARTIFACT_ID: sonar-scanner-maven
36+
run: |
37+
if [[ -z "${{ github.event.inputs.version }}" ]]; then
38+
echo "version not provided, pulling latest version from $REPO."
39+
echo LATEST_VERSION=$(curl -s -u ${ARTIFACTORY_PRIVATE_USERNAME}:${ARTIFACTORY_PRIVATE_PASSWORD} \
40+
"${ARTIFACTORY_URL}/api/search/latestVersion?g=${GROUP_ID}&a=${ARTIFACT_ID}&repos=${REPO}") >> "$GITHUB_OUTPUT"
41+
else
42+
echo "version is provided, using its value: ${{ github.event.inputs.version }}."
43+
echo "LATEST_VERSION=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
44+
fi
45+
- uses: SonarSource/gh-action_releasability@v2
1546
env:
1647
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
branch: ${{ github.ref_name }}
50+
commit-sha: ${{ github.sha }}
51+
organization: ${{ github.repository_owner }}
52+
repository: ${{ github.event.repository.name }}
53+
version: ${{ steps.latest-version.outputs.LATEST_VERSION }}

its/pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
<artifactId>sonar-maven-plugin</artifactId>
2525
</dependency>
2626
<dependency>
27-
<groupId>org.sonarsource.scanner.maven</groupId>
27+
<groupId>org.example.integration</groupId>
2828
<artifactId>property-dump-plugin</artifactId>
29-
<version>1-SNAPSHOT</version>
29+
<version>1.0-SNAPSHOT</version>
30+
<scope>test</scope>
3031
</dependency>
3132
<dependency>
3233
<groupId>org.junit.jupiter</groupId>

its/src/test/java/com/sonar/maven/it/suite/AbstractMavenTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public abstract class AbstractMavenTest {
7878
.addBundledPluginToKeep("sonar-xml-plugin")
7979
.addBundledPluginToKeep("sonar-html-plugin")
8080
// This plugin should have been built locally from the property-dump-plugin module
81-
.addPlugin(FileLocation.of("../property-dump-plugin/target/property-dump-plugin-1-SNAPSHOT.jar"))
81+
.addPlugin(FileLocation.of("../property-dump-plugin/target/property-dump-plugin-1.0-SNAPSHOT.jar"))
8282
.build();
8383

8484
protected WsClient wsClient;

property-dump-plugin/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
<version>5.1.0-SNAPSHOT</version>
1111
</parent>
1212

13+
<groupId>org.example.integration</groupId>
1314
<artifactId>property-dump-plugin</artifactId>
14-
<version>1-SNAPSHOT</version>
15+
<version>1.0-SNAPSHOT</version>
1516
<packaging>sonar-plugin</packaging>
1617

1718
<properties>

0 commit comments

Comments
 (0)