Skip to content

Commit

Permalink
Fix: Unbound variable causing script to fail
Browse files Browse the repository at this point in the history
When the environment variable `IGNORE_PROJECT_IDS` is not provided the
GithubAction is failing with the error:

```
/src/main.sh: line 49: IGNORE_PROJECT_IDS: unbound variable
```

Setting a default empty value should solve the issue.
  • Loading branch information
rafaeljusto committed Dec 14, 2021
1 parent 8950bb7 commit 305d000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ main() {
project_id="$(teamwork::get_project_id_from_task "$task_id")"
export TEAMWORK_PROJECT_ID=$project_id

ignored_project_ids=("$IGNORE_PROJECT_IDS")
ignored_project_ids=("${IGNORE_PROJECT_IDS:-}")
if (( ${#ignored_project_ids[@]} != 0 )) || utils::in_array "$1" "${ignored_project_ids[*]}"
then
log::message "ignored due to IGNORE_PROJECT_IDS"
Expand Down

0 comments on commit 305d000

Please sign in to comment.