fix(action): workaround for private repos
Download repo tarball instead of trying to use git switch to the proper branch.
This commit is contained in:
parent
1db9349c00
commit
20b96580ba
1 changed files with 10 additions and 4 deletions
14
action.yml
14
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
|
||||
|
|
Loading…
Reference in a new issue