Skip to content

Commit

Permalink
feat: initial version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Nov 18, 2020
1 parent fc9377a commit 13d0a16
Show file tree
Hide file tree
Showing 13 changed files with 15,342 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
push:
branches:
- main
- next
- beta
- "*.x" # maintenance releases

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
- run: npm ci
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.PROBOTBOT_NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test
"on":
push:
branches:
- main
- dependabot/npm_and_yarn/**
pull_request:
types:
- opened
- synchronize
jobs:
test_matrix:
runs-on: ubuntu-latest
strategy:
matrix:
node_version:
- 10
- 12
- 14
steps:
- uses: actions/checkout@v2
- name: "Use Node.js ${{ matrix.node_version }}"
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node_version }}"
- run: npm ci
- run: npm test

# separate job to set as required in branch protection,
# as the above change each time the Node versions change
test:
runs-on: ubuntu-latest
needs: test_matrix
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: npm run lint
21 changes: 21 additions & 0 deletions .github/workflows/update-prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update Prettier
"on":
push:
branches:
- dependabot/npm_and_yarn/prettier-*
jobs:
update_prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: "npm run lint:fix"
- uses: gr2m/create-or-update-pull-request-action@v1.x
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
title: Prettier updated
body: An update to prettier required updates to your code.
branch: "${{ github.ref }}"
commit-message: "style: prettier"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
node_modules
pkg
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# WORK IN PROGRESS [#1](https://github.com/probot/get-private-key/pull/1)

# @probot/get-private-key

> Get private key from a path, environment variables, or a `*.pem` file in the current working directory
> Get private key from a file path, environment variables, or a `*.pem` file in the current working directory
[![@latest](https://img.shields.io/npm/v/@probot/get-private-key.svg)](https://www.npmjs.com/package/@probot/get-private-key)
[![Build Status](https://github.com/probot/get-private-key/workflows/Test/badge.svg)](https://github.com/probot/get-private-key/actions?query=workflow%3ATest)

Finds a private key through various user-(un)specified methods. Order of precedence:

1. Explicit path option
2. `PRIVATE_KEY` environment variable or explicit `env.PRIVATE_KEY` option
1. Explicit file path option
2. `PRIVATE_KEY` environment variable or explicit `env.PRIVATE_KEY` option. The private key can optionally be base64 encoded.
3. `PRIVATE_KEY_PATH` environment variable or explicit `env.PRIVATE_KEY_PATH` option
4. Any file w/ `.pem` extension in current working dir

Expand Down Expand Up @@ -66,7 +64,7 @@ const probot = new Probot({
<tbody align=left valign=top>
<tr>
<th>
<code>options.path</code>
<code>options.filepath</code>
</th>
<td>
<code>string<code>
Expand All @@ -77,7 +75,7 @@ Pass a path to a `*.pem` file. A relative path will be resolved to the current w

```js
const privateKey = getPrivateKey({
path: "private-key.pem",
filepath: "private-key.pem",
});
```

Expand All @@ -92,7 +90,7 @@ const privateKey = getPrivateKey({
</td>
<td>

Defaults to `process.cwd()`. Used to resolve the `path` option and used as folder to find `*.pem` files.
Defaults to `process.cwd()`. Used to resolve the `filepath` option and used as folder to find `*.pem` files.

```js
const privateKey = getPrivateKey({
Expand Down
Loading

0 comments on commit 13d0a16

Please sign in to comment.