diff --git a/action.yml b/action.yml index 2653b1f..9e98fc5 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,8 @@ description: | You can post this report as a comment to the PR associated with the current branch and/or export the report as a markdown artifact. - Requires `nix`, `jq`, `curl`, `sed` and `coreutils` to be in path. + Requires `nix`, `jq`, `curl`, `sed`, `gunzip`, `tar` and `coreutils` to be in + the runner's path. Usage: @@ -98,10 +99,15 @@ runs: } if [ "$PRIVATE_REPO" = 'true' ]; then - log "In a private repo, switching to $HEAD_BRANCH to build the old report" - git switch "$HEAD_BRANCH" + log "In a private repo, downloading $HEAD_BRANCH to build the old report" - "$GITHUB_ACTION_PATH/create-report.sh" > old-report.json + mkdir -p old + curl -X 'GET' \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/archive/$HEAD_BRANCH.tar.gz" \ + -H "Authorization: token $GITHUB_TOKEN" | + tar -zvx --strip-components=1 -C old + + (cd old && "$GITHUB_ACTION_PATH/create-report.sh") > old-report.json log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH" "$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json