Skip to content
Merged
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
13 changes: 4 additions & 9 deletions .github/workflows/check-published-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ name: Check Published

on:
schedule:
- cron: '11 23 * * *'
- cron: '45 18 * * *'

jobs:
checkPublished:
runs-on: ubuntu-latest
name: Check Published
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Check Published
uses: checkdigit/github-actions/check-published@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
DEBUG: '*'
SLACK_PUBLISH_MISMATCH: ${{ secrets.SLACK_PUBLISH_MISMATCH }}
23 changes: 14 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@ on:
branches:
- 'main'

env:
CI: true

jobs:
pullRequestBuild:
name: Pull Request Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 23.x]
node-version: ['24.x', '26.x']
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Compile
run: npm run ci:compile
Expand All @@ -31,21 +35,22 @@ jobs:
run: npm run ci:test

branchBuild:
runs-on: ubuntu-latest
name: Branch Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x, 23.x]
node-version: ['24.x', '26.x']
steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Compile
run: npm run ci:compile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
71 changes: 51 additions & 20 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,69 @@ name: Coverage

on:
pull_request:
branches:
- 'main'
branches: [main]

env:
CI: true
concurrency:
group: coverage-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
coverage:
base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/setup-node@v7
with:
node-version: '26.x'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run coverage
run: npm run ci:coverage
- uses: actions/upload-artifact@v7
with:
name: base-coverage
path: coverage/lcov.info
if-no-files-found: error

pr:
runs-on: ubuntu-latest
name: Coverage
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: '22.x'
node-version: '26.x'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Calculate Code Coverage
- name: Run coverage
run: npm run ci:coverage
- name: Create Coverage Report for base branch
run: |
mv coverage/lcov.info coverage/lcov_head.info
git fetch
git checkout origin/${{ github.event.pull_request.base.ref }}
npm ci --ignore-scripts && npm run ci:coverage
- name: Post Coverage Report
- uses: actions/upload-artifact@v7
with:
name: pr-coverage
path: coverage/lcov.info
if-no-files-found: error

report:
name: Coverage
needs: [base, pr]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Require successful coverage jobs
if: ${{ needs.base.result != 'success' || needs.pr.result != 'success' }}
run: exit 1
- uses: actions/download-artifact@v8
with: { name: base-coverage, path: coverage }
- uses: actions/download-artifact@v8
with: { name: pr-coverage, path: coverage-pr }
- name: Post coverage report
uses: checkdigit/github-actions/coverage-reporter@main
with:
lcov-file: 'coverage/lcov_head.info'
lcov-base: 'coverage/lcov.info'
coverage-results-folder-pr: 'coverage-pr'
coverage-results-folder-base: 'coverage'
delete-old-comments: true
46 changes: 0 additions & 46 deletions .github/workflows/publish-beta.yml

This file was deleted.

51 changes: 44 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,64 @@ name: Publish
on:
release:
types: [created]
pull_request:
branches:
- 'main'

jobs:
publish:
name: ${{ github.event_name == 'release' && 'Publish Release' || 'Publish Beta' }}
if: >-
(github.event_name == 'release' && github.event.action == 'created') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.base.ref == 'main' &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
environment: npm-publish
permissions:
contents: read
id-token: write
name: Publish to NPM
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: '22.x'
node-version: '26.x'
package-manager-cache: false
registry-url: 'https://registry.npmjs.org'
- name: Check Label
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/check-label@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Imports
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/check-imports@main
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Audit Signatures
run: npm audit signatures
- name: Publish
run: npm publish --provenance
- name: Run Test
if: github.event_name == 'pull_request'
run: npm run ci:test
- name: Prepare Beta
if: github.event_name == 'pull_request'
id: prepare-beta
uses: checkdigit/github-actions/prepare-beta@main
- name: Publish Release
if: github.event_name == 'release'
run: npm publish
- name: Publish Beta
if: github.event_name == 'pull_request'
run: npm publish --tag beta
- name: Comment npm publish result
if: github.event_name == 'pull_request'
uses: checkdigit/github-actions/comment-npm-publish@main
with:
betaPackage: ${{ steps.prepare-beta.outputs.betaPackage }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2021-2025 Check Digit, LLC
Copyright (c) 2021-2026 Check Digit, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `@checkdigit/timeout`

Copyright (c) 2023–2025 [Check Digit, LLC](https://checkdigit.com)
Copyright © 2021-2026 [Check Digit, LLC](https://checkdigit.com)

The `@checkdigit/timeout` module implements the recommended Check Digit timeout algorithm for promises.

Expand All @@ -16,11 +16,10 @@ npm install @checkdigit/timeout
import timeout from '@checkdigit/timeout';

// await a promise, with the default 60 second timeout
await timeout(new Promise(....));
await timeout(new Promise(/* ... */));

// await a promise, but with a 10 second timeout
await timeout(new Promise(....), { timeout: 10000 });

await timeout(new Promise(/* ... */), { timeout: 10000 });
```

## License
Expand Down
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Supported Versions

These versions of `@checkdigit/retry` are currently being supported with security updates.
These versions of `@checkdigit/timeout` are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| \>= 5.0 | :white_check_mark: |
| \< 5.0 | :x: |
| \>= 6.0 | :white_check_mark: |
| \< 6.0 | :x: |

## Reporting a Vulnerability

Please create an issue at https://github.com/checkdigit/retry/issues
Please create an issue at https://github.com/checkdigit/timeout/issues
Loading
Loading