diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..ced847c --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,15 @@ +name: Setup +description: 'Installs node, driver dependencies, and builds source' + +runs: + using: composite + steps: + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + - run: npm install -g npm@latest + shell: bash + - run: npm clean-install + shell: bash diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8ac6b8c..22ef6a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,31 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests schedule: interval: "monthly" + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + ignore: + # chai is esmodule only. + - dependency-name: "chai" + versions: [">=5.0.0"] + # nyc is Node18+ only starting on nyc@16.x. + - dependency-name: "nyc" + versions: [">=16.0.0"] + # we ignore TS as a part of quarterly dependency updates. + - dependency-name: "typescript" + groups: + development-dependencies: + dependency-type: "development" + applies-to: version-updates + update-types: + - "minor" + - "patch" diff --git a/.github/scripts/highlights.mjs b/.github/scripts/highlights.mjs new file mode 100644 index 0000000..20d5542 --- /dev/null +++ b/.github/scripts/highlights.mjs @@ -0,0 +1,77 @@ +// @ts-check +import * as process from 'node:process'; +import { output } from './util.mjs'; + +const { + GITHUB_TOKEN = '', + PR_LIST = '', + REPOSITORY = '' +} = process.env; +if (GITHUB_TOKEN === '') throw new Error('GITHUB_TOKEN cannot be empty'); +if (REPOSITORY === '') throw new Error('REPOSITORY cannot be empty') + +const API_REQ_INFO = { + headers: { + Accept: 'application/vnd.github.v3+json', + 'X-GitHub-Api-Version': '2022-11-28', + Authorization: `Bearer ${GITHUB_TOKEN}` + } +} + +const prs = PR_LIST.split(',').map(pr => { + const prNum = Number(pr); + if (Number.isNaN(prNum)) + throw Error(`expected PR number list: ${PR_LIST}, offending entry: ${pr}`); + return prNum; +}); + +/** @param {number} pull_number */ +async function getPullRequestContent(pull_number) { + const startIndicator = 'RELEASE_HIGHLIGHT_START -->'; + const endIndicator = '