Skip to content

Commit

Permalink
Add info log when fetching git tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Mar 7, 2021
1 parent 953bdcc commit 073a4b9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
21 changes: 14 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions src/utils/github-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,22 @@ export async function downloadArtifact(
}

export async function listFiles(octokit: InstanceType<typeof GitHub>, sha: string): Promise<string[]> {
core.info('Fetching list of tracked files from GitHub')
const commit = await octokit.git.getCommit({
commit_sha: sha,
...github.context.repo
})
const files = await listGitTree(octokit, commit.data.tree.sha, '')
return files
core.startGroup('Fetching list of tracked files from GitHub')
try {
const commit = await octokit.git.getCommit({
commit_sha: sha,
...github.context.repo
})
const files = await listGitTree(octokit, commit.data.tree.sha, '')
return files
} finally {
core.endGroup()
}
}

async function listGitTree(octokit: InstanceType<typeof GitHub>, sha: string, path: string): Promise<string[]> {
const pathLog = path ? ` at ${path}` : ''
core.info(`Fetching tree ${sha}${pathLog}`)
let truncated = false
let tree = await octokit.git.getTree({
recursive: 'true',
Expand Down

0 comments on commit 073a4b9

Please sign in to comment.