Skip to content

Commit

Permalink
fix: upgrade dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop Node < 18
  • Loading branch information
wolfy1339 committed Dec 9, 2024
1 parent d656e6e commit 4cb79ce
Show file tree
Hide file tree
Showing 14 changed files with 2,107 additions and 17,822 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
branches:
- master
- next
- beta
- "*.x"

# These are recommended by the semantic-release docs: https://github.com/semantic-release/npm#npm-provenance
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.PROBOTBOT_NPM_TOKEN }}
116 changes: 116 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Test
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize

permissions:
contents: read

jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v4

license-check:
name: Check Licenses
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Check Licenses
run: npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;Apache 2.0;Python-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT"

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint

test-unit:
name: Test on Node ${{ matrix.node-version }}
strategy:
matrix:
node-version:
- 18
- 20
- 22
- latest
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test

test:
runs-on: ubuntu-latest
needs:
- test-unit

steps:
- run: exit 1
if: ${{ needs.test-unit.result != 'success'}}
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test:coverage
- name: Update Codecov
run: npx codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ always() }}
7 changes: 0 additions & 7 deletions .npmignore

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,44 @@ $ npm install auth-routes
## Usage

```js
const { registerAuthRoutes } = require('auth-routes')
const { registerAuthRoutes } = require("auth-routes");

const app = express()
const app = express();
registerAuthRoutes(app, {
client_id: process.env.GITHUB_CLIENT_ID,
client_secret: process.env.GITHUB_CLIENT_SECRET
})
client_secret: process.env.GITHUB_CLIENT_SECRET,
});

// Or pass some options:
registerAuthRoutes(app, {
loginURL: '/log-me-in',
callbackURL: '/call-me-back',
loginURL: "/log-me-in",
callbackURL: "/call-me-back",
client_id: process.env.GITHUB_CLIENT_ID,
client_secret: process.env.GITHUB_CLIENT_SECRET
})
client_secret: process.env.GITHUB_CLIENT_SECRET,
});
```

### Use with Probot

```js
module.exports = app => {
module.exports = (app) => {
// Access the Express server that Probot uses
const expressApp = app.route()
const expressApp = app.route();

// Register the routes as normal
registerAuthRoutes(expressApp, {
client_id: process.env.GITHUB_CLIENT_ID,
client_secret: process.env.GITHUB_CLIENT_SECRET
})
}
client_secret: process.env.GITHUB_CLIENT_SECRET,
});
};
```

## Options

| Name | Description | Required | Default |
| ------- | ----------- | ------- | ------- |
| `client_id` | GitHub App's Client ID || - |
| `client_secret` | GitHub App's Client Secret || - |
| `loginURL` | Login path | | `'/login'` |
| `callbackURL` | Authorization callback URL, for your GitHub App | | `'/login/cb'` |
| `afterLogin` | Where users are redirected to after they've logged in | | `'/'` |
| Name | Description | Required | Default |
| --------------- | ----------------------------------------------------- | -------- | ------------- |
| `client_id` | GitHub App's Client ID | | - |
| `client_secret` | GitHub App's Client Secret | | - |
| `loginURL` | Login path | | `'/login'` |
| `callbackURL` | Authorization callback URL, for your GitHub App | | `'/login/cb'` |
| `afterLogin` | Where users are redirected to after they've logged in | | `'/'` |
Loading

0 comments on commit 4cb79ce

Please sign in to comment.