-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Use release-drafter/release-drafter
GitHub Action to label our PRs
#4868
Conversation
Limit the `GITHUB_TOKEN` permissions for `toolmantim/release-drafter` to the minimum required permissions.
Limit the `GITHUB_TOKEN` permissions for `TimonVS/pr-labeler-action` to the minimum required permissions.
`branch` is not a valid configuration option for release-drafter, see https://github.com/release-drafter/release-drafter#configuration-options There's is a similar [`references` option][1], but it does nothing when using GitHub Actions (it's only there for GitHub apps). There's also `commitish`, but it defaults to the target/branch the GitHub Action job runs on, so we don't need to set that. [1]: https://github.com/release-drafter/release-drafter#references
Using `pull_request_target` is pretty dangerous, since it heavily increases the risk of malicious PRs getting access to the mermaid-js repo. What we're doing currently is safe, but we should add a warning message just to ensure that we're very careful when we make changes. See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target See: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
Change the formatting of .github/pr-labeler.yml to make `git diff`'s easier to understand in a future commit.
Replace the `TimonVS/pr-labeler-action` with `release-drafter/release-drafter` as it has an [`autolabeler`][1] option that can autolabel PRs for us. This should fix labeling PRs from forks, see TimonVS/pr-labeler-action#25. I've kept the `.github/pr-labeler.yml` configuration file, so that links to it from the https://mermaid.js.org website continue to work. I've also kept everything in the same `.github/workflows/pr-labeler.yml` GitHub Actions workflow to make the `git diff` easier to review, and to keep the GitHub Actions permissions the same. [1]: https://github.com/release-drafter/release-drafter/blob/ff929b5ceb21bf2646a216e916f9a8bb507d48a3/README.md#autolabeler
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #4868 +/- ##
===========================================
- Coverage 79.33% 77.58% -1.75%
===========================================
Files 164 148 -16
Lines 13864 13025 -839
Branches 698 612 -86
===========================================
- Hits 10999 10106 -893
- Misses 2715 2765 +50
- Partials 150 154 +4
Flags with carried forward coverage won't be shown. Click here to find out more. |
This value is unused, but it's required, so we have to add it. Fixes: a1673d3
1c357ff
to
99beeba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good!
* develop: (164 commits) Update all patch dependencies Fix docs Update packages/mermaid/src/docs/community/questions-and-suggestions.md Update packages/mermaid/src/diagrams/class/classRenderer-v2.ts update edge ids draw top actors with lines first followed by messages Bump GitHub workflow actions to latest versions Update docs Documentation: clarify sentence Fix lint Fix typo fix typo Add new Atlassian integrations chore(deps): update all patch dependencies Update demos/sequence.html chore: release v10.6.1 fix fix fix: render the participants in same order as they are created fix(flow): fix invalid ellipseText regex ...
📑 Summary
Replace the
TimonVS/pr-labeler-action
withrelease-drafter/release-drafter
(previously known astoolmantim/release-drafter
, which we already use for drafting releases) as it has anautolabeler
option that can autolabel PRs for us.This should fix labeling PRs from forks, see TimonVS/pr-labeler-action#25 (this is why some PRs keep having the
feature
/fix
/chore
labels).📏 Design Decisions
I've kept the
.github/pr-labeler.yml
configuration file, so that links to it from the https://mermaid.js.org/ website continue to work.I've also kept everything in the same
.github/workflows/pr-labeler.yml
GitHub Actions workflow to make thegit diff
easier to review, and to keep the GitHub Actions permissions the same.While I was here, I also set the GitHub Action
permissions
so that they have the minimum require permissions needed to do anything.📋 Tasks
Make sure you
This PR should be labeled with the Type: Other label if everything works as expected.It looks like the auto-labeler will only work once everything is merged, since it looks at thepr-labeler.yml
file of thedevelop
branch.MERMAID_RELEASE_VERSION
is used for all new features.pr-labeler.yml
will continue to work, e.g.mermaid/packages/mermaid/src/docs/community/code.md
Line 40 in b054766
develop
branchThe
pr-labeler.yml
GitHub Action will fail in this branch, since it