- 
                Notifications
    
You must be signed in to change notification settings  - Fork 168
 
Set default values on workflow_dispatch input #1987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Set default values on workflow_dispatch input #1987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for defining and applying default values to workflow_dispatch inputs via a new workflowInputDefaults repository setting. Updates include implementation logic, schema extension, documentation, release notes, and corresponding tests.
- Introduces ApplyWorkflowInputDefaults to inject validated defaults into workflow YAML.
 - Extends settings schema and default settings; exports SanitizeWorkflowName for name matching.
 - Adds comprehensive tests and documentation for the new setting.
 
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description | 
|---|---|
| Actions/CheckForUpdates/CheckForUpdates.HelperFunctions.ps1 | Implements ApplyWorkflowInputDefaults and integrates it into workflow processing. | 
| Actions/.Modules/ReadSettings.psm1 | Adds default and exports SanitizeWorkflowName for reuse. | 
| Actions/.Modules/settings.schema.json | Adds schema definition for workflowInputDefaults. | 
| Tests/CheckForUpdates.Action.Test.ps1 | Adds test cases covering application and validation of input defaults. | 
| Scenarios/settings.md | Documents new workflowInputDefaults setting. | 
| RELEASENOTES.md | Announces new feature with example configuration. | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…-sensitive matching and update related test cases
…efault-values-on-workflow_dispatch-input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PSScriptAnalyzer found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
          
 🫣 I'll need to get this PSScriptAnalyzer to work... Will update  | 
    
…efault-values-on-workflow_dispatch-input
… and related tests
| 
           Strange, I believe these tests worked last week. I'll investigate  | 
    
| 
           @mazhelez I cannot see this error coming from this PR, do you? 🤔 The failing test: This PR do not touch  It complains on the last of these lines: 
 It would probably work if I just added  Advice? 🙂  | 
    
| 
           Just realized that I could run the CI pipeline for this branch in my own repo, and it is failing as well - so now I can test things out myself. Going forward, I will run CI self before creating PRs. 👍  | 
    
          
 It looks like   | 
    
          
 I agree, something weird is going on. :)  | 
    
| 
           @mazhelez it was a scoping issue, I believe...  I've never really got my head around the scoping in PS... But if you kick on the workflow again, it should pass!  | 
    
Related to discussion: #1952
❔What, Why & How
This pull request introduces a new feature that allows repository maintainers to specify default values for workflow inputs using the
workflowInputDefaultssetting. This makes it easier to run workflows manually with consistent input values and improves configuration management for workflows triggered viaworkflow_dispatch. The implementation includes updates to documentation, schema validation, and the workflow update logic to support this feature.New Feature: Workflow Input Defaults
workflowInputDefaultssetting in repository settings, enabling configuration of default values for workflow_dispatch inputs. The setting is now read and applied when updating AL-Go system files. [1] [2]ApplyWorkflowInputDefaultsfunction inCheckForUpdates.HelperFunctions.ps1to validate and inject default values into workflow YAML files. This function ensures the value types match input definitions and provides error messages for misconfigurations.Documentation and Schema Updates
settings.schema.jsonto define the structure forworkflowInputDefaults, including type validation and descriptions for each property.settings.mdand added release notes inRELEASENOTES.mdto explain usage, configuration, and validation for the new setting. [1] [2]Other Improvements
SanitizeWorkflowNamefunction to support workflow name matching when applying defaults.Note
The "hide" functionality mentioned in the discussion will come in its own PR when this is completed, to keep this PR cleaner and easier to review.
✅ Checklist