Skip to content

Add GitHub Actions workflow for updating static web assets baselines #49730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 10, 2025

This PR adds a GitHub Actions workflow that automates the process of updating static web assets baselines for pull requests, eliminating the need for manual intervention by developers.

Features

The workflow (update-static-web-assets-baselines.yml) provides:

  • Manual dispatch trigger with PR number input for targeted baseline updates
  • Automated PR branch checkout using GitHub CLI
  • Full project build via ./build.sh -c Release
  • Proper environment setup with DOTNET_ROOT configuration
  • Baseline update execution using src/RazorSdk/update-test-baselines.sh
  • Smart change detection for JSON files in test directories
  • Automatic commit and push with standardized commit messages
  • PR status feedback through automated comments

Usage

Developers can trigger the workflow using GitHub CLI:

# Update baselines for PR #1234
gh workflow run update-static-web-assets-baselines.yml -f pr_number=1234

# Monitor workflow progress
gh run watch

Workflow Behavior

The workflow provides clear feedback through PR comments:

  • "Baselines updated." - When changes are successfully committed and pushed
  • "No baselines were updated." - When baselines are already up-to-date
  • "Update baselines failed: [reason]" - When errors occur during the process

Error Handling

The workflow includes comprehensive error handling for:

  • Build script failures
  • Baseline update script failures
  • Git commit/push failures

Each failure scenario provides specific error messages to help developers diagnose issues.

Implementation Details

The workflow follows established patterns in the repository:

  • Uses actions/checkout@v4 for repository access
  • Leverages GitHub CLI for PR operations
  • Implements proper permissions for content and PR management
  • Uses continue-on-error for graceful failure handling
  • Follows the existing commit message format: [Infrastructure] Update baselines YYYY-MM-DD

This automation significantly streamlines the baseline update process, reducing manual overhead and potential errors while maintaining consistency across the development workflow.

Fixes #49729.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 10, 2025 16:18
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [Infrastructure] GH action for updating baselines on existing PRs Add GitHub Actions workflow for updating static web assets baselines Jul 10, 2025
@Copilot Copilot AI requested a review from javiercn July 10, 2025 16:20
Copilot finished work on behalf of javiercn July 10, 2025 16:20
@javiercn javiercn requested a review from MackinnonBuck July 10, 2025 19:09
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.

[Infrastructure] GH action for updating baselines on existing PRs
2 participants