WIP scripts for scraping and processing Github Actions workflow runs data.
To run from the command line:
deno run --no-check --allow-net=api.github.com --allow-env="GITHUB_TOKEN" --allow-write index.ts [workflow_name]
A zsh
function which searches through the contributors to the repo in the current working directory, and generates 'co-authored by' messages for them, that can then be copied into your commit messages.
Searches through names and email addresses that have been used in commit messages in the current repo. The -S
flag means that searches are 'smart case' by default: case insensitive, unless upper case letters are included in the search string, in which instance it will switch to case sensitive search. Other options can be found in the ripgrep
user guide.
// `CallSite` is the class representing a stack frame in the V8 spec | |
// (see https://v8.dev/docs/stack-trace-api#customizing-stack-traces) | |
// hat tip to the callsites package, where I'm importing the `CallSite` type from: https://github.com/sindresorhus/callsites | |
import { CallSite } from "https://raw.githubusercontent.com/sindresorhus/callsites/7fb22a67645ea741cc016937e8f3662eb533eb6e/index.d.ts"; | |
// there is a default implementation for preparing stack traces on the Error object, but TypeScript doesn't recognise | |
// this. (maybe because it's not present in all runtimes? or maybe the default is initialised in some other way?) | |
type ErrorWithPrepFn = ErrorConstructor & { prepareStackTrace?: (error: Error, stack: CallSite[]) => unknown} |