forked from DesigniteTools/DJAction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
41 lines (40 loc) · 1.79 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: DesigniteJava
description: Analyzes the newly commited code, detects comprehensive set of code smells, and uploads the results to QScored.
branding:
color: 'orange'
icon: 'arrow-up-right'
inputs:
PAT:
description: 'Personal access token'
default: 'No PAT provided'
QSCORED_API_KEY:
description: 'provide the QScored api'
default: 'No qscore provided'
EMAIL:
description: 'User name (email) for QScored'
default: 'No username provided'
PRJ_NAME:
description: 'QScored project name'
default: ${{ github.event.repository.name }}
OPEN_SOURCE:
description: 'is code quality results open-source? True/False'
default: False
D_KEY:
description: 'Designite license key - optional'
default: 'No key'
runs:
using: "composite"
steps:
- name: Download DesigniteJava
run: wget "https://www.designite-tools.com/static/download/DJE/DesigniteJava.jar"
shell: sh
- name: Analyze project with DesigniteJava and upload the results to QScored
run: |
if [[ "${{inputs.D_KEY}}" == "No key" ]]; then
java -jar DesigniteJava.jar -ci -repo $GITHUB_REPOSITORY -pat ${{ inputs.PAT }}
fi
if [[ "${{inputs.D_KEY}}" != "No key" ]]; then
java -jar DesigniteJava.jar -ci -repo $GITHUB_REPOSITORY -pat ${{ inputs.PAT }} -k inputs.D_KEY
fi
curl -X PUT -H "Authorization: Token ${{ inputs.QSCORED_API_KEY }}" -H "repository-link:https://github.com/" + ${{ github.repository }} -H "username:${{ inputs.EMAIL }}" -H "Content-Type: mulitpart/form-data" --url "https://qscored.com/api/upload/file.xml?is_open_access=${{ inputs.OPEN_SOURCE }}&version=$GITHUB_RUN_NUMBER&project_name=${{ inputs.PRJ_NAME }}" -F "file=@Designite_output/DesigniteAnalysis.xml"
shell: bash