@@ -2,6 +2,11 @@ name: Releasability status
2
2
3
3
on :
4
4
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
5
10
6
11
jobs :
7
12
update_releasability_status :
11
16
id-token : write
12
17
contents : read
13
18
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
15
46
env :
16
47
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 }}
0 commit comments