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

ci(e2e): avoid commenting on PRs in CI, fixing PRs from forks #5365

Conversation

aloisklink
Copy link
Member

📑 Summary

GitHub Actions can't comment on PRs, if the PR is made from a forked repo, as the github token won't have write permissions. This causes the E2E CI to fail in most PRs, e.g. see #5338 (comment)

However, we can instead use GitHub Actions' Adding a Job Summary feature, which prints some custom output for each job. This also means that we can calculate the bundle size for push events, not just PRs. For example, see https://github.com/aloisklink/mermaid/actions/runs/8177226929:

image

The only issue is that

Fix: e0448a7

📏 Design Decisions

📋 Tasks

Make sure you

GitHub Actions can't comment on PRs, if the PR is made from a forked
repo, as [the github token won't have write permissions][1].

However, we can instead use GitHub Actions' [Adding a Job Summary][2]
feature, which prints some custom output for each job.

[1]: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#changing-the-permissions-in-a-forked-repository
[2]: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary

Fix: e0448a7
@aloisklink aloisklink added Area: DevOps Skip changelog Don't include in the changelog labels Mar 6, 2024
Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 46136b5
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/65e8c477caa8dc00087a8abc
😎 Deploy Preview https://deploy-preview-5365--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.67%. Comparing base (821076b) to head (46136b5).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5365   +/-   ##
========================================
  Coverage    44.67%   44.67%           
========================================
  Files           25       25           
  Lines         5339     5339           
  Branches        27       27           
========================================
  Hits          2385     2385           
  Misses        2953     2953           
  Partials         1        1           
Flag Coverage Δ
unit 44.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sidharthv96 sidharthv96 added this pull request to the merge queue Mar 7, 2024
@sidharthv96 sidharthv96 removed this pull request from the merge queue due to a manual request Mar 7, 2024
@sidharthv96 sidharthv96 merged commit 4884b01 into mermaid-js:develop Mar 7, 2024
19 checks passed
@aloisklink aloisklink deleted the ci/stop-commenting-size-diff-in-PRs branch March 7, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: DevOps Skip changelog Don't include in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants