INNER CODE UNIT · TypeScript

getChangedFiles

PostHog/posthog · .github/actions/paths-filter/src/main.ts:73

async function getChangedFiles(
  token: string,
  base: string,
  ref: string,
  initialFetchDepth: number
): Promise<ChangedFiles> {
  // if base is 'HEAD' only local uncommitted changes will be detected
  // This is the simplest case as we don't need to fetch more commits or evaluate current/before refs
  if (base === git.HEAD) {
    if (ref) {
      core.warning(`'ref' input parameter is ignored when 'base' is set to HEAD`)
    }
    return {files: await git.getChangesOnHead()}
  }

  switch (github.context.eventName) {
    // To keep backward compatibility, commits in GitHub pull request event
    // take precedence over manual inputs.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…