Skip to content

Commit

Permalink
chore: addressing PR comments
Browse files Browse the repository at this point in the history
As per title.

Contributes to: #126

Signed-off-by: Stelios Gkiokas <[email protected]>
  • Loading branch information
sgkiokas committed Sep 7, 2021
1 parent 306525c commit d0caaf7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,23 @@ jobs:
- name: Jira ticket creation
id: jira_integration
uses: ./actions-jira-integration/
env:
ISSUE_TYPE: 'Security Vulnerability'
ISSUE_LABELS_MAPPER: 'Security,Triaged,npm_audit_check'
JIRA_PROJECT: MBIL
with:
JIRA_USER: ${{ secrets.JIRA_USER }}
JIRA_PASSWORD: ${{ secrets.JIRA_PASSWORD }}
# the job with id npm_audit outputs a variable called npm_audit_json
INPUT_JSON: ${{ steps.npm_audit.outputs.npm_audit_json }}
JIRA_PROJECT: MBIL
JIRA_PROJECT: ${{ env.JIRA_PROJECT }}
JIRA_URI: 'jira.camelot.global'
REPORT_INPUT_KEYS: |
issueName: {{module_name}}
issueSummary: npm-audit: {{module_name}} module vulnerability\n
issueDescription: \`*Recommendation*:\\n\\n{{recommendation}}\\n\\n*Details for {{cwe}}*\\n\\n_Vulnerable versions_:\\n\\n{{vulnerable_versions}}\\n\\n_Patched versions_:\\n\\n{{patched_versions}}\\n\\n*Overview*\\n\\n{{overview}}\\n\\n*References*\\n\\n{{url}}\\n\\n`
issueSeverity: {{severity}}
ISSUE_TYPE: 'Security Vulnerability'
ISSUE_TYPE: ${{ env.ISSUE_TYPE }}
RUNS_ON_GITHUB: true
PRIORITY_MAPPER: |
low: P3
Expand Down
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ const kickOffAction = async (inputJson) => {
);
const reportPairsMapper = utils.populateMap(REPORT_INPUT_KEYS);
const issueLabelsMapper = utils.getInput('ISSUE_LABELS_MAPPER');
const labels =
issueLabelsMapper.length !== 0
? { labels: issueLabelsMapper.split(',') }
: { labels: [] };

let labels = { labels: [] };
if (issueLabelsMapper.length === 1) {
labels = { labels: issueLabelsMapper };
} else if (issueLabelsMapper.length > 1) {
labels = { labels: issueLabelsMapper.split(',') };
}

const parsedInput = JSON.parse(inputJson);
for (const inputElement in parsedInput) {
Expand Down

0 comments on commit d0caaf7

Please sign in to comment.