Skip to content

Conversation

@sylvainsf
Copy link
Contributor

Description

Fix the approval-gate job in functional-test-cloud.yaml that was incorrectly gating PRs from org members (like PR #11177 from DariuszPorowski).

Root cause: The expression environment: ${{ <condition> && 'external-contributor-approval' || '' }} evaluates to an empty string '' for trusted users. However, GitHub Actions treats an empty string as a valid environment reference (creating an empty-named environment), NOT as "skip using an environment."

Fix: Changed the approach to skip the approval-gate job entirely for trusted users via if condition, rather than using a conditional environment. Updated the setup job to also allow needs.approval-gate.result == 'skipped' so downstream jobs proceed correctly.

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and does not change the functionality of Radius (issue link optional).

Contributor checklist

Please verify that the PR mPlease verify that tequirPlease verify that the PR mPlease verify that tequirPlease verify that the PR mPlease verify that tequirPlease verify that the PR mPlease ver -->Please verify that the PR mPlease verify that tequirPlease verify that the PR mPlease verify that tequirPlease verify that the PR mPlease verify that tequirPlease verify that the PR mPlease ver -->Please verify that the PR mPlease verify that tequirPlease verify that the PR mPlease verify that tequirPlease verify that the PR mPl reviewed and approved by Radius maintainers/approvers.
- [ ] Yes
- [x] Not applicable

  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • Not applicable

The && operator has higher precedence than || in GitHub expressions.
Without parentheses, the expression was incorrectly evaluating to
'external-contributor-approval' for ALL PRs, blocking org members.

Fixed by adding parentheses around the trusted user check so it
correctly returns '' (empty/no environment) for dependabot and
org members (OWNER, MEMBER, COLLABORATOR).

Before (buggy):
  actor == 'dependabot[bot]' || contains(...) && '' || 'external-...'

After (fixed):
  (actor == 'dependabot[bot]' || contains(...)) && '' || 'external-...'
…ronment

Signed-off-by: Sylvain Niles <sylvainniles@microsoft.com>
@sylvainsf sylvainsf requested review from a team as code owners February 5, 2026 16:49
@sylvainsf sylvainsf requested a deployment to external-contributor-approval February 5, 2026 16:50 — with GitHub Actions Waiting
@sylvainsf sylvainsf closed this Feb 5, 2026
@sylvainsf sylvainsf deleted the fix-approval-gate-empty-environment branch February 5, 2026 16:52
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.

1 participant