Skip to content

Commit

Permalink
fix: Added additional case handling to logic that pulls workflow inpu…
Browse files Browse the repository at this point in the history
…ts (#1833)

## Description

Added additional case handling to logic that pulls workflow inputs to
account for non-required parameters without defaults
This did already work for workflow-dispatch but not merge to main

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.ptn.security.security-center](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.ptn.security.security-center.yml/badge.svg?branch=users%2Falsehr%2FcustomLocalFollowUp)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.ptn.security.security-center.yml)
|

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utlities (Non-module effecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation
  • Loading branch information
AlexanderSehr authored May 3, 2024
1 parent a5c9af8 commit f1b281e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/actions/templates/avm-getWorkflowInput/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ runs:
# Output values to be accessed by next jobs
$workflowInput = @{}
foreach($parameterName in $parameters.Keys) {
if([String]::IsNullOrEmpty($parameters[$parameterName])) {
Write-Verbose "Skipping parameter [$parameterName] as it has no explicit or default value" -Verbose
continue
}
Write-Verbose ('Passing output [{0}] with value [{1}]' -f $parameterName, $parameters[$parameterName]) -Verbose
$workflowInput[$parameterName] = $parameters[$parameterName]
}
Expand All @@ -88,6 +93,12 @@ runs:
# Output values to be accessed by next jobs
$workflowInput = @{}
foreach($parameterName in $workflowParameters.Keys) {
if([String]::IsNullOrEmpty($workflowParameters[$parameterName])) {
Write-Verbose "Skipping parameter [$parameterName] as it has no explicit or default value" -Verbose
continue
}
Write-Verbose ('Passing output [{0}] with value [{1}]' -f $parameterName, $workflowParameters[$parameterName]) -Verbose
$workflowInput[$parameterName] = $workflowParameters[$parameterName].toString()
}
Expand Down

0 comments on commit f1b281e

Please sign in to comment.