@beesley/pr-metadata
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Build, Test & Publish Main

@beesley/pr-metadata

A tool for reading information about pull requests within github actions. Works as a cli or as a node module. Expects a GITHUB_TOKEN env var to be set.

CLI Usage

npx @beesley/pr-metadata --help
# Options:
#   --help      Show help                                                                       [boolean]
#   --version   Show version number                                                             [boolean]
#   --dirNames  Whether to return directory names instead of file names                         [boolean] [default: false]
#   --json      Whether to return result as a json string                                       [boolean] [default: true]
#   --filter    An array of globs to act as an include filter for where we look for changes     [array]

npx @beesley/pr-metadata
# [".commitlintrc.json","src/__mocks__/mock-context.json","src/__mocks__/push-event.json","src/get-changed-files.test.ts","src/get-changed-files.ts","src/index.ts"]

npx @beesley/pr-metadata --json false
# [
#   '.commitlintrc.json',
#   'src/__mocks__/mock-context.json',
#   'src/__mocks__/push-event.json',
#   'src/get-changed-files.test.ts',
#   'src/get-changed-files.ts',
#   'src/index.ts'
# ]

npx @beesley/pr-metadata --dirNames
# ["bin","src/__mocks__","src"]

npx @beesley/pr-metadata --dirNames --filter '**' --filter '!**/__mocks__/**'
# ["bin","src"]

npx @beesley/pr-metadata --filter 'src/**'
# ["src/__mocks__/mock-context.json","src/__mocks__/push-event.json","src/get-changed-files.test.ts","src/get-changed-files.ts","src/index.ts"]

API

Table of Contents

getChangedFiles

src/get-changed-files.ts:13-17

Uses github actions metadata to get a list of changes files or directories

Parameters

  • json boolean Whether or not to return json
  • dirNames boolean Whether or not to return only directory names
  • filter Array<string>? Filter globs to filter results using

Returns any {(Promise<string | string[]>)} The changed files or directories

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.69latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.69
1.0.51
1.0.41
1.0.31
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i @beesley/pr-metadata

Weekly Downloads

15

Version

1.0.6

License

MIT

Unpacked Size

159 kB

Total Files

23

Last publish

Collaborators

  • bbeesley