Skip to content
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

feat: Allow commenting on pull_request from workflow_run #316

Merged
merged 12 commits into from
Dec 17, 2023

Conversation

davelosert
Copy link
Owner

@davelosert davelosert commented Dec 16, 2023

This pull request adds support for pull requests from forks. The most significant changes include updating the README.md file with a new section on handling pull requests from forks by modifying src/writeSummaryToPR.ts which will now:

  1. Check if it is being ran in a workflow triggered by the workflow_run event
  2. Get the triggering workflow from the REST API
  3. Checking if the triggering workflow was triggered by a pull_request event
  4. Trying to get the number of the pull request:
    1. if the pull request came from the same repo, it will just use the pull_requests attribute
    2. if the pull request came from a fork, it will iterate through all pull_requests until it found one with a head_sha matching the one from the triggering workflow

Copy link
Contributor

github-actions bot commented Dec 16, 2023

Coverage Report for Mock Reports (./test/mockReports)

Status Category Percentage Covered / Total
🔵 Lines 41.37% 60 / 145
🔵 Statements 41.33% 62 / 150
🔵 Functions 62.06% 18 / 29
🔵 Branches 39.65% 23 / 58
File CoverageNo changed files found.
Generated in workflow #614

Copy link
Contributor

github-actions bot commented Dec 16, 2023

Coverage Report for Root

Status Category Percentage Covered / Total
🔵 Lines 52.58% 387 / 736
🔵 Statements 52.58% 387 / 736
🔵 Functions 73.68% 14 / 19
🔵 Branches 90% 63 / 70
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/writeSummaryToPR.ts 0% 0% 0% 0% 1-124
Unchanged Files
src/FileCoverageMode.ts 100% 100% 100% 100%
src/generateFileCoverageHtml.ts 100% 100% 100% 100%
src/generateFileUrl.ts 94.44% 50% 100% 94.44% 6
src/generateHeadline.ts 100% 100% 100% 100%
src/generateSummaryTableHtml.ts 100% 100% 100% 100%
src/getPullChanges.ts 0% 0% 0% 0% 1-58
src/getUncoveredLinesFromStatements.ts 100% 100% 100% 100%
src/getViteConfigPath.ts 98.03% 87.5% 100% 98.03% 39
src/icons.ts 100% 100% 100% 100%
src/index.ts 0% 0% 0% 0% 1-80
src/options.ts 0% 0% 0% 0% 1-35
src/parseCoverageThresholds.ts 100% 100% 100% 100%
src/parseJsonReports.ts 0% 0% 0% 0% 1-50
Generated in workflow #614

@davelosert davelosert changed the title feat: Add pull request number as an input feat: Allow commenting on pull_request from workflow_run Dec 17, 2023
@davelosert davelosert merged commit d8cdd10 into main Dec 17, 2023
3 checks passed
@davelosert davelosert deleted the add-pr-option branch December 17, 2023 12:33
github-actions bot pushed a commit that referenced this pull request Dec 17, 2023
# [2.2.0](v2.1.1...v2.2.0) (2023-12-17)

### Features

* Allow commenting on pull requests from forks ([#316](#316)) ([d8cdd10](d8cdd10))
Copy link
Contributor

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant