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

Release workflow #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow is triggered on pushes to the master branch and creates a release
# with the "latest" tag. it also removes any previous associated releases.
---
name: "release"

on:
push:
branches:
- "master"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: latest
- name: Build
run: |
npm install
gulp generic
- name: Create Release
run: tar czf build.tar.gz -C build .
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
files: "build.tar.gz"
18 changes: 18 additions & 0 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,24 @@
}
}
PDFViewerApplication.run(config);
window.addEventListener('message', handlePostMessage);
}

const postMessageHandlers = {
open(msg) {
const { pdfData } = msg;
PDFViewerApplication.open({ data: pdfData })
}
};

function handlePostMessage(event) {

Check warning

Code scanning / CodeQL

Missing origin verification in `postMessage` handler Medium

Postmessage handler has no origin check.
const { type, msg } = event.data;
const handler = postMessageHandlers[type];
if (!handler) {
console.error(`pdf.js: no handler for postMessage with type ${type}`)

Check warning

Code scanning / CodeQL

Log injection Medium

Log entry depends on a
user-provided value
.
return;
}
return handler(msg);

Check failure

Code scanning / CodeQL

Unvalidated dynamic method call High

Invocation of method with
user-controlled
name may dispatch to unexpected target and cause an exception.
}

// Block the "load" event until all pages are loaded, to ensure that printing
Expand Down
Loading