fix(action): unpack outside git repo

Otherwise it thinks it is the original flake
This commit is contained in:
Jalil David Salamé Messina 2024-12-18 22:03:13 +01:00
parent 20b96580ba
commit 09d8ea071d
Signed by: jalil
GPG key ID: F016B9E770737A0B

View file

@ -101,13 +101,13 @@ runs:
if [ "$PRIVATE_REPO" = 'true' ]; then if [ "$PRIVATE_REPO" = 'true' ]; then
log "In a private repo, downloading $HEAD_BRANCH to build the old report" log "In a private repo, downloading $HEAD_BRANCH to build the old report"
mkdir -p old old=$(mktemp -d)
curl -X 'GET' \ curl -X 'GET' \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/archive/$HEAD_BRANCH.tar.gz" \ "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/archive/$HEAD_BRANCH.tar.gz" \
-H "Authorization: token $GITHUB_TOKEN" | -H "Authorization: token $GITHUB_TOKEN" |
tar -zvx --strip-components=1 -C old tar -zvx --strip-components=1 -C "$old"
(cd old && "$GITHUB_ACTION_PATH/create-report.sh") > old-report.json (cd "$old" && "$GITHUB_ACTION_PATH/create-report.sh") > old-report.json
log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH" log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH"
"$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json "$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json