Skip to content

Commit

Permalink
docs: documented isBaseDiffFromHead behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Dec 7, 2020
1 parent fc8c547 commit 20830ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 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.

7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import {rmRF} from '@actions/io';

const COMMENT_SIGNATURE = sub('🤖 This report was automatically generated by [pkg-size-action](https://github.com/privatenumber/pkg-size-action/)');

// TODO: make sure this will work with empty commits or reverted changes
// TODO: make sure this doesnt consider unstaged files
/*
* Compares files between current ref and the base ref (not commits)
* The clean up (git reset --hard) that happens is crucial as it
* takes into consideration unstaged files
*/
async function isBaseDiffFromHead(baseRef) {
try {
await exec(`git fetch origin ${baseRef} --depth=1`);
Expand Down

0 comments on commit 20830ca

Please sign in to comment.