Skip to content

GHA: Update testing-farm action to use main branch#458

Draft
lsm5 wants to merge 2 commits intomainfrom
lsm5-pull-request-target
Draft

GHA: Update testing-farm action to use main branch#458
lsm5 wants to merge 2 commits intomainfrom
lsm5-pull-request-target

Conversation

@lsm5
Copy link
Copy Markdown
Member

@lsm5 lsm5 commented Apr 21, 2026

v2 was released quite sometime ago.
GHA: set trigger to pull_request_target

  • Remove checkout step (Testing Farm clones the repo on VM)
  • Use PR head repo/sha to test actual PR changes
  • Fallback to base repo for push events
  • Keeps secrets isolated from untrusted PR code

Summary by Sourcery

Update the Testing Farm XML validation workflow to run on pull_request_target and use PR-specific sources while keeping secrets isolated from untrusted code.

CI:

  • Switch the XML validation workflow trigger from pull_request to pull_request_target to improve security for PR runs.
  • Update the Testing Farm GitHub Action to track the main branch and use PR head repository/commit with a fallback to the base repository for non-PR events.
  • Remove the explicit checkout step from the XML validation workflow since the Testing Farm action clones the repository itself.

v2 was released quite sometime ago.
GHA: set trigger to pull_request_target

- Remove checkout step (Testing Farm clones the repo on VM)
- Use PR head repo/sha to test actual PR changes
- Fallback to base repo for push events
- Keeps secrets isolated from untrusted PR code

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 21, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the XML validation GitHub Actions workflow to run on pull_request_target, use the main branch of the Testing Farm action, drop the checkout step, and configure Testing Farm to test the actual PR head for pull requests while falling back to the base repo/ref for other events.

File-Level Changes

Change Details Files
Switch workflow trigger from pull_request to pull_request_target to improve secret isolation for PRs.
  • Replace the pull_request event trigger with pull_request_target for the workflow while keeping push to main unchanged
  • Ensure that the workflow still only runs for the main branch
.github/workflows/xmllint-validation.yml
Update Testing Farm action usage and inputs to rely on the PR head repo/ref and remove unnecessary checkout.
  • Remove the explicit checkout step since Testing Farm clones the repository itself
  • Change the Testing Farm GitHub Action reference from version v2 to the main branch
  • Set git_url to the PR head repository clone_url with a fallback to the base repository URL for non-PR events
  • Set git_ref to the PR head SHA with a fallback to github.ref for non-PR events
.github/workflows/xmllint-validation.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

- Add basic-check job that runs after xmllint-validation passes
- Extract common parameters (git_url, git_ref) to workflow-level env
- Each job provisions a separate Testing Farm instance
- Sequential execution ensures early stopping on validation failure

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
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