Skip to content

chore: fix pr preview actions#327

Merged
ziqisia merged 4 commits into
mainfrom
fix-pr-preview-aex
Jun 5, 2025
Merged

chore: fix pr preview actions#327
ziqisia merged 4 commits into
mainfrom
fix-pr-preview-aex

Conversation

@adaex

@adaex adaex commented May 22, 2025

Copy link
Copy Markdown
Collaborator

This pull request updates the GitHub Actions workflow for PR previews to improve permissions handling and simplify the process of creating or updating comments with preview links. The main changes include adding explicit permissions and replacing the peter-evans actions with a custom script using actions/github-script for better flexibility and maintainability.

Workflow Permissions Update:

  • Added explicit contents: read and pull-requests: write permissions to the workflow, ensuring the necessary access for commenting on pull requests. (.github/workflows/pr-preview.yml, .github/workflows/pr-preview.ymlR6-R9)

Comment Handling Simplification:

  • Replaced the peter-evans/find-comment and peter-evans/create-or-update-comment actions with a custom script using actions/github-script. The script checks for an existing bot comment with the PR preview link and either updates it or creates a new one, improving customization and control over comment management. (.github/workflows/pr-preview.yml, .github/workflows/pr-preview.ymlL58-R101)

@github-actions

github-actions Bot commented May 22, 2025

Copy link
Copy Markdown

PR Preview Link: https://preview-327-arco-design-mobile.surge.sh

@adaex adaex requested a review from Copilot May 22, 2025 13:37

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

Updates the PR preview workflow to tighten permissions and replace external actions with a custom script for comment management

  • Added explicit permissions for workflow tokens
  • Removed peter-evans steps and introduced an actions/github-script step to list, update, or create PR preview comments

Comment thread .github/workflows/pr-preview.yml
Comment thread .github/workflows/pr-preview.yml Outdated
Comment thread .github/workflows/pr-preview.yml Outdated
@codecov

codecov Bot commented May 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.71%. Comparing base (c14d0d2) to head (56f425d).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #327      +/-   ##
==========================================
- Coverage   90.11%   89.71%   -0.40%     
==========================================
  Files         141      141              
  Lines        8257     8393     +136     
  Branches     3389     3447      +58     
==========================================
+ Hits         7441     7530      +89     
- Misses        792      835      +43     
- Partials       24       28       +4     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adaex adaex requested a review from Copilot May 30, 2025 10:26

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 updates the GitHub Actions workflow for PR previews by defining explicit permissions and replacing third‐party actions with a custom script for creating or updating preview comments.

  • Added explicit permissions for repository content, pull request updates, and issues.
  • Replaced the peter-evans actions with an actions/github-script step that searches for and updates or creates a PR preview comment.
Comments suppressed due to low confidence (1)

.github/workflows/pr-preview.yml:63

  • [nitpick] Consider renaming this step to 'Create/Update PR Comment' to more clearly reflect its purpose of handling both creation and updates of PR comments.
- name: Create PR Comment

@ziqisia ziqisia merged commit e04f22e into main Jun 5, 2025
7 checks passed
@ziqisia ziqisia deleted the fix-pr-preview-aex branch June 5, 2025 09:28
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