Skip to content

ci: add trusted AKS e2e trigger for fork PRs#2600

Open
fseldow wants to merge 1 commit into
mainfrom
xinhl/promote-fork-pr-aks-e2e
Open

ci: add trusted AKS e2e trigger for fork PRs#2600
fseldow wants to merge 1 commit into
mainfrom
xinhl/promote-fork-pr-aks-e2e

Conversation

@fseldow

@fseldow fseldow commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

  • Add /run-aks-e2e issue-comment workflow for maintainers.
  • Promote the PR merge ref to a temporary trusted-pr-<number>-<sha> branch.
  • Restore .github/workflows and .github/actions from the PR base branch before dispatching e2e-aks.yml.
  • Comment back with the trusted branch and workflow run details.

Why

Fork PRs cannot access the Azure secrets/OIDC credentials needed by AKS e2e. This provides a maintainer-approved path to run the AKS e2e workflow from a trusted branch after review.

Safety

The issue_comment workflow only validates the commenter permission, creates the trusted branch, and dispatches the AKS workflow. It does not build or test fork code inside the orchestration job.

Add a maintainer-only issue comment workflow that promotes a PR merge ref to a temporary trusted branch with base branch GitHub workflows/actions restored, then dispatches the AKS e2e workflow against that branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 24, 2026 08:58
- created

permissions:
contents: write
contents: write
pull-requests: read
issues: write
actions: write
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.66%. Comparing base (665c33c) to head (9652a01).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2600   +/-   ##
=======================================
  Coverage   77.66%   77.66%           
=======================================
  Files         105      105           
  Lines        4657     4657           
=======================================
  Hits         3617     3617           
  Misses        892      892           
  Partials      148      148           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a maintainer-triggered GitHub Actions workflow to enable running the AKS e2e suite for fork-based pull requests by creating a trusted temporary branch (based on the PR merge ref) and restoring trusted workflow/action definitions from the PR base branch before dispatching e2e-aks.yml.

Changes:

  • Add an issue_comment-triggered workflow that listens for /run-aks-e2e on PRs.
  • Create/push a trusted-pr-<number>-<sha> branch from the PR merge ref, restoring .github/workflows and .github/actions from the base branch.
  • Dispatch the AKS e2e workflow on the trusted branch and comment back with branch/run details.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +41
permission="$(gh api "repos/${GITHUB_REPOSITORY}/collaborators/${COMMENT_AUTHOR}/permission" --jq '.permission')"
case "${permission}" in
admin|maintain|write)
echo "Commenter ${COMMENT_AUTHOR} has ${permission} permission."
;;
*)
gh pr comment "${PR_NUMBER}" --body "AKS e2e was not started. @${COMMENT_AUTHOR} does not have write, maintain, or admin permission on this repository."
exit 1
;;
esac
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.

3 participants