Skip to content

Commit

Permalink
Fix optional inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nora Söderlund committed Sep 5, 2023
1 parent d84dd91 commit 0587d01
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ inputs:

JIRA_KEY_MULTIPLE:
description: If true and JIRA_KEY is a project key, post a comment for every story key found.
default: false

JIRA_PARTIAL_KEY_SILENT_FAILURE:
description: If true, not finding a story key in a pull request if a project key is specified, only throws a silent error.
default: false

DISABLE_PULL_REQUEST_COMMENT:
description: If true, using the action will not create or update a pull request comment. Useful for only fetching the issue details from the output.
default: false

outputs:
title:
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira-summary-action",
"version": "0.9.0",
"version": "0.9.1",
"description": "A GitHub Action that posts the summary of a linked Jira story in pull requests.",
"main": "dist/index.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ async function execute(storyKey: string) {

const description = adf2md.convert(issueDetails.fields.description);

if(!getInput("JIRA_KEY_MULTIPLE")) {
if(getInput("JIRA_KEY_MULTIPLE") !== "") {
setOutput("title", issueDetails.fields.summary);
setOutput("description", description.result);
}

if(context.payload.pull_request) {
if(getInput("DISABLE_PULL_REQUEST_COMMENT")) {
if(getInput("DISABLE_PULL_REQUEST_COMMENT") !== "") {
console.info("Not creating or update any comments because DISABLE_PULL_REQUEST_COMMENT is true.");

return;
Expand Down Expand Up @@ -117,7 +117,7 @@ async function init() {
}

if(!storyKeys.length) {
if(getInput("JIRA_PARTIAL_KEY_SILENT_FAILURE")) {
if(getInput("JIRA_PARTIAL_KEY_SILENT_FAILURE") !== "") {
console.error("Failed to find a Jira key starting with " + jiraKey);

console.info("Executing silent error because JIRA_PARTIAL_KEY_SILENT_FAILURE is true.");
Expand All @@ -128,7 +128,7 @@ async function init() {
return;
}

if(getInput("JIRA_KEY_MULTIPLE")) {
if(getInput("JIRA_KEY_MULTIPLE") !== "") {
for(let storyKey of storyKeys)
execute(storyKey);
}
Expand Down

0 comments on commit 0587d01

Please sign in to comment.