ci: add trusted AKS e2e trigger for fork PRs#2600
Open
fseldow wants to merge 1 commit into
Open
Conversation
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>
| - created | ||
|
|
||
| permissions: | ||
| contents: write |
| contents: write | ||
| pull-requests: read | ||
| issues: write | ||
| actions: write |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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-e2eon PRs. - Create/push a
trusted-pr-<number>-<sha>branch from the PR merge ref, restoring.github/workflowsand.github/actionsfrom 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/run-aks-e2eissue-comment workflow for maintainers.trusted-pr-<number>-<sha>branch..github/workflowsand.github/actionsfrom the PR base branch before dispatchinge2e-aks.yml.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_commentworkflow 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.