Skip to content

[Developer:Documentation] Update README.md for Github releasing #671

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

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

micpap25
Copy link
Contributor

@micpap25 micpap25 commented Jul 1, 2024

No description provided.

README.md Outdated
Comment on lines 76 to 86

## Building
Commit your built files when contributing.
If on Windows, change the `build` script in `package.json` to `webpack && SET MINIFY=1&webpack`.
```bash
# switch to node v14 or earlier
$ nvm use 14

# build the dist files
$ npm run build
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the dist/ files are minified, relying purely on PR authors for updating the dist files themselves opens the door to potential exploits that are hard to detect. The attack would be that a malicious actor writes some fix for a bug and also their attack, creates the dist/ files, removes their attack, and then creates the PR. The PR reviewer will (understandably) not look over the built minified file as it's basically impossible to, and instead evaluate just the src/ change, and then go, yup, looks good, PR gets merged, and then if that build gets released (likely as there's not that many releases), the attack then gets the main Submitty repo.

My suggestion would be that you use GH actions to either:

  1. Confirm that within the test workflow that the files generated by npm run build match what's in a given commit
  2. Have a GH action that runs on any push to main by a non-bot user that then does npm run build and that then commits the built files (if any changes).

My personal preference would be (2) as it lowers the barrier to making PRs as it's one less thing to worry about within a PR, and is also not having the dist files show up in the files changed pane always, and that generating the build is a perfect thing for automation. GH actions are also already setup such that if you have on: push, if you push a branch using GITHUB_TOKEN, it would not trigger a subsequent workflow run, so it's pretty straight forward to implement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the advice! See Submitty/Submitty#10667. We very infrequently touch this repository but we'll keep all this in mind in case a contributor rolls around.

@bmcutler bmcutler merged commit 04127ff into main Jul 9, 2024
6 checks passed
@bmcutler bmcutler deleted the micpap25-patch-1 branch July 9, 2024 18:03
@@ -19,7 +19,7 @@ To report issues for pdf-annotate.js, please file them under the [Submitty/Submi
## Installation

```bash
npm install @submitty/pdf-annotate.js
npm install Submitty/pdf-annotate.js

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Does this mean that pdf-annotate won't be published anymore on NPM? If yes, where can I read more about this decision?! 👀

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

Successfully merging this pull request may close these issues.

5 participants