Skip to content

Add support for conditional settings based on GitHub event triggers#2238

Open
ChrisBlankDe wants to merge 2 commits intomicrosoft:mainfrom
ChrisBlankDe:feature/disc2207
Open

Add support for conditional settings based on GitHub event triggers#2238
ChrisBlankDe wants to merge 2 commits intomicrosoft:mainfrom
ChrisBlankDe:feature/disc2207

Conversation

@ChrisBlankDe
Copy link
Copy Markdown
Contributor

❔What, Why & How

This pull request adds support for using workflow trigger events as a condition in ConditionalSettings, allowing you to apply settings based on the GitHub Actions event type (e.g., push, pull_request, schedule, workflow_dispatch). Documentation and tests are updated to reflect this new feature.

Conditional settings enhancements:

  • Added a new triggers condition to ConditionalSettings, enabling settings to be applied based on the value of GITHUB_EVENT_NAME (such as push, pull_request, schedule, workflow_dispatch)

Documentation updates:

  • Updated settings.md and RELEASENOTES.md to document the new triggers condition, including usage examples.

Test coverage:

  • Extended tests in ReadSettings.Test.ps1 to verify correct behavior when using the new triggers condition in ConditionalSettings.

Related to issue: #2207

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 12:44
@ChrisBlankDe ChrisBlankDe requested a review from a team as a code owner May 5, 2026 12:44
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 using the GitHub Actions event name as a ConditionalSettings selector in ReadSettings, so AL-Go settings can vary by trigger type such as push, pull_request, schedule, or workflow_dispatch.

Changes:

  • Added a new -trigger parameter to ReadSettings and included triggers in conditional-settings evaluation.
  • Extended ReadSettings tests to cover matching and non-matching trigger conditions.
  • Updated settings documentation and release notes to describe the new triggers condition.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Tests/ReadSettings.Test.ps1 Adds unit coverage for trigger-based conditional settings.
Scenarios/settings.md Documents triggers as a supported conditional-settings selector.
RELEASENOTES.md Announces the new trigger-based conditional settings support.
Actions/.Modules/ReadSettings.psm1 Implements trigger-aware conditional settings in ReadSettings.

Comment thread Scenarios/settings.md
Copy link
Copy Markdown
Collaborator

@aholstrup1 aholstrup1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there are some failing tests. Otherwise looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants