Skip to content

Commit

Permalink
Merge pull request #6 from AlecBlance/feat/cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecBlance authored Oct 11, 2024
2 parents 411f735 + cfdbe02 commit 9cc1f5b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-moles-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gdrive-pdftotext": minor
---

Add support for password protected file / change docs / fix rate limitting issue
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run lint && npm run build
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

A node module to extract texts from a PDF in Google Drive. It doesn't require Google Drive API, and it extracts even if "Viewers can't download, print and copy".

## ! NOTICE !
## Usage/Examples

This will be added in npm soon.
Install

## Usage/Examples
```bash
npm i gdrive-pdfToText
```

```javascript
import gdrivePdf from "gdrive-pdfToText";
Expand All @@ -15,6 +17,7 @@ const test = async () => {
const driveUrl =
"https://drive.google.com/file/d/1pGOAwzneiFqjRYOLvrXaR10U6sffQSCn/view?usp=sharing";
const text = await gdrivePdf.pdfToText(driveUrl);
// await gdrivePdf.pdfToText(driveUrl, "password")
console.log("🎃 Drive Url: ", driveUrl);
console.log("🎉 Extracted Text:", text);
};
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build": "tsup index.ts --format cjs,esm --dts",
"dev": "nodemon index.ts",
"dev-sample": "nodemon sample/index.ts",
"lint": "tsc"
"lint": "tsc",
"release": "npm run build && changeset publish"
},
"keywords": [
"google",
Expand Down

0 comments on commit 9cc1f5b

Please sign in to comment.