chore: fix pr preview actions#327
Conversation
|
✨ PR Preview Link: https://preview-327-arco-design-mobile.surge.sh |
There was a problem hiding this comment.
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-evanssteps and introduced anactions/github-scriptstep to list, update, or create PR preview comments
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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-evansactions with a custom script usingactions/github-scriptfor better flexibility and maintainability.Workflow Permissions Update:
contents: readandpull-requests: writepermissions 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:
peter-evans/find-commentandpeter-evans/create-or-update-commentactions with a custom script usingactions/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)