Skip to content

Redesign e2e workflow with reusable workflow pattern#704

Draft
wikkyk wants to merge 11 commits intomainfrom
e2e-redesign
Draft

Redesign e2e workflow with reusable workflow pattern#704
wikkyk wants to merge 11 commits intomainfrom
e2e-redesign

Conversation

@wikkyk
Copy link
Copy Markdown
Collaborator

@wikkyk wikkyk commented Apr 8, 2026

Issue #, if available:

fixes #447
depends on #702

Description of changes:

Converts the e2e workflow into a reusable workflow with two minimal dispatchers:

  • e2e-main.yml: triggers on push to main and pull_request for same-repo PRs
  • e2e-external.yml: triggers on pull_request_target for fork and dependabot PRs

Since e2e-main is now on a pull_request trigger, we can actually test workflow changes within a PR.

Enables Flatcar tests on main - with the new runner it's feasible to run these more often and we reduce the risk of Flatcar support bitrotting.

Other than that, practical behaviour remains the same.

Testing performed:

CodeQL analyze actions + actionlint
e2e label triggers

@wikkyk wikkyk force-pushed the claude/review-github-workflows-2i3Hc branch 8 times, most recently from 7215969 to 3ec4f33 Compare April 8, 2026 21:07
@wikkyk wikkyk added e2e/none skip all e2e tests (documentation etc) - overrides all e2e/* labels and removed e2e/none skip all e2e tests (documentation etc) - overrides all e2e/* labels labels Apr 8, 2026
@wikkyk wikkyk added the e2e/flatcar run Flatcar e2e tests label Apr 9, 2026
@wikkyk wikkyk added the github_actions Pull requests that update GitHub Actions code label Apr 10, 2026
wikkyk and others added 7 commits April 17, 2026 12:41
Remove branch filters from pull_request/pull_request_target triggers
so that CI runs for PRs opened against any branch (e.g. WIP branches
like v1alpha3/wip). Restrict push triggers to main only to avoid
duplicate runs when pushing to branches with open PRs.

Co-authored-by: Claude <noreply@anthropic.com>
Rework triggers: push only fires on v* tags (no longer on branch
pushes), pull_request fires on all PRs with no branch filter.
Previously branch pushes to main/release-* would build and push
images to GHCR; now only tag releases do. PRs still build the
image for validation without pushing.

Co-authored-by: Claude <noreply@anthropic.com>
…issions

Add permissions: contents: read to test, e2e, and codespell workflows
which were missing explicit permissions blocks. Downgrade container-image
from contents: write to contents: read. Resolves CodeQL code scanning
alerts #34, #30, and #19.

Co-authored-by: Claude <noreply@anthropic.com>
Add a concurrency group keyed by PR number (or commit SHA for push
events) with cancel-in-progress. Placed at job level so the old run
continues until the new run passes its environment approval gate,
then gets cancelled.

Co-authored-by: Claude <noreply@anthropic.com>
Replace ${{ env.* }} expression interpolation with quoted shell
variable expansion to prevent potential command injection via
environment variables.

Co-authored-by: Claude <noreply@anthropic.com>
The sonarqube-scan-action only requires SONAR_TOKEN for authentication.
GITHUB_TOKEN is not used by the action.

Co-authored-by: Claude <noreply@anthropic.com>
Split e2e into three files:
- e2e.yml: reusable workflow with all test logic (checkout, test,
  artifacts, cleanup). Runs Flatcar tests on main, skips on PRs
  unless e2e/flatcar label is set. Concurrency per-PR, per-SHA
  for pushes.
- e2e-main.yml: triggers for push to main and same-repo PRs.
  Excludes dependabot (handled by e2e-external).
- e2e-external.yml: triggers for fork and dependabot PRs via
  pull_request_target.

This enables testing workflow changes in PRs (pull_request trigger)
while keeping pull_request_target for fork/dependabot secret access.
Fixes #447.

Co-authored-by: Claude <noreply@anthropic.com>
claude and others added 4 commits April 17, 2026 12:43
Use github.event.pull_request.user.login instead of github.actor
for dependabot detection — actor can change on re-runs. Add fork
guard to e2e-main.yml for completeness.

Co-authored-by: Claude <noreply@anthropic.com>
Pass secrets to reusable workflow via secrets: inherit. Without this,
environment secrets from the e2e environment are not accessible in the
called workflow even though it declares environment: e2e.

Co-authored-by: Claude <noreply@anthropic.com>
Remove dependabot special-casing from e2e dispatchers. Dependabot
has its own secret store and works with pull_request trigger, so it
goes through e2e-main.yml like any same-repo PR. e2e-external.yml
is now fork-only.

Co-authored-by: Claude <noreply@anthropic.com>
@wikkyk wikkyk force-pushed the claude/review-github-workflows-2i3Hc branch from aa99b2e to ade227b Compare April 17, 2026 12:50
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

Base automatically changed from claude/review-github-workflows-2i3Hc to main April 21, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e/flatcar run Flatcar e2e tests github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants