Skip to content

Commit

Permalink
v2.0.0 (#131)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This package is now ESM only.

* feat: add support for PKCS8 keys (#129)

Co-authored-by: Samuel El-Borai <sam@elborai.me>

* chore: modernize and migrate to esm (#127)

Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>

---------

Co-authored-by: Samuel El-Borai <sam@elborai.me>
Co-authored-by: wolfy1339 <4595477+wolfy1339@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 3, 2024
1 parent eec780a commit 7ed7bf1
Show file tree
Hide file tree
Showing 10 changed files with 4,020 additions and 7,376 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
node_version:
- 18
- 20
- 22
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Finds a private key through various user-(un)specified methods. Order of precede
3. `PRIVATE_KEY_PATH` environment variable or explicit `env.PRIVATE_KEY_PATH` option
4. Any file w/ `.pem` extension in current working dir

Supports both PKCS1 (i.e `-----BEGIN RSA PRIVATE KEY-----`) and PKCS8 (i.e `-----BEGIN PRIVATE KEY-----`).

## Usage

<table>
Expand All @@ -30,10 +32,16 @@ Node
Install with <code>npm install @probot/get-private-key</code>

```js
const { Probot } = require("probot");
const { getPrivateKey } = require("@probot/get-private-key");
import { Probot } from "probot";
import { getPrivateKey } from "@probot/get-private-key";
```

> [!IMPORTANT]
> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`.
>
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)
</td></tr>
</tbody>
</table>
Expand Down
Loading

0 comments on commit 7ed7bf1

Please sign in to comment.