1.0.6 • Published 1 year ago

@beesley/pr-metadata v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

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

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago